slang: Check return value from new_instruction().
authorMichal Krol <michal@vmware.com>
Tue, 10 Nov 2009 03:03:55 +0000 (04:03 +0100)
committerMichal Krol <michal@vmware.com>
Tue, 10 Nov 2009 03:03:55 +0000 (04:03 +0100)
src/mesa/shader/slang/slang_emit.c

index d4a61dcd490150030d0cfa5d159c2060e34ed308..5eabe615b9331e509d7125ee14a2fe6998102ab9 100644 (file)
@@ -1254,7 +1254,9 @@ emit_return(slang_emit_info *emitInfo, slang_ir_node *n)
    assert(n->Opcode == IR_RETURN);
    assert(n->Label);
    inst = new_instruction(emitInfo, OPCODE_RET);
-   inst->DstReg.CondMask = COND_TR;  /* always return */
+   if (inst) {
+      inst->DstReg.CondMask = COND_TR;  /* always return */
+   }
    return inst;
 }