nv50/ir: check for origin insn in findOriginForTestWithZero
Function arguments do not have an "origin" instruction, causing a NULL-pointer dereference without this check. Signed-off-by: Pierre Moreau <pierre.morrow@free.fr> Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
This commit is contained in:
committed by
Samuel Pitoiset
parent
d54b498694
commit
655c395f65
@@ -410,6 +410,8 @@ ConstantFolding::findOriginForTestWithZero(Value *value)
|
||||
if (!value)
|
||||
return NULL;
|
||||
Instruction *insn = value->getInsn();
|
||||
if (!insn)
|
||||
return NULL;
|
||||
|
||||
if (insn->asCmp() && insn->op != OP_SLCT)
|
||||
return insn->asCmp();
|
||||
|
||||
Reference in New Issue
Block a user