nv50/ir: fix crash in isUniform for undefined values
authorKarol Herbst <kherbst@redhat.com>
Sat, 2 Nov 2019 23:57:28 +0000 (00:57 +0100)
committerKarol Herbst <kherbst@redhat.com>
Sun, 3 Nov 2019 00:02:52 +0000 (01:02 +0100)
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
src/gallium/drivers/nouveau/codegen/nv50_ir.cpp

index a181a13..ae07d96 100644 (file)
@@ -274,6 +274,8 @@ LValue::isUniform() const
    if (defs.size() > 1)
       return false;
    Instruction *insn = getInsn();
+   if (!insn)
+      return false;
    // let's not try too hard here for now ...
    return !insn->srcExists(1) && insn->getSrc(0)->isUniform();
 }