mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 05:18:08 +02:00
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:
parent
d54b498694
commit
655c395f65
1 changed files with 2 additions and 0 deletions
|
|
@ -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();
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue