diff options
author | Brian <[email protected]> | 2007-03-10 10:37:18 -0700 |
---|---|---|
committer | Brian <[email protected]> | 2007-03-10 10:37:18 -0700 |
commit | c9872b80c874ce7891c6b07c2d4f2fe099fdd8cd (patch) | |
tree | 282ed8c85457988e7e6e8813618bab6369b5c221 /src/mesa | |
parent | 46bd63819e0fb108d13df0672372e500cf56bbbe (diff) |
add NULL ptr check in emit_cond()
Diffstat (limited to 'src/mesa')
-rw-r--r-- | src/mesa/shader/slang/slang_emit.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/mesa/shader/slang/slang_emit.c b/src/mesa/shader/slang/slang_emit.c index 8ad61d8a3b0..6d39354d755 100644 --- a/src/mesa/shader/slang/slang_emit.c +++ b/src/mesa/shader/slang/slang_emit.c @@ -1014,8 +1014,12 @@ emit_cond(slang_emit_info *emitInfo, slang_ir_node *n) * Need to update condition code register. * Next instruction is typically an IR_IF. */ - /* last child expr instruction: */ - struct prog_instruction *inst = emit(emitInfo, n->Children[0]); + struct prog_instruction *inst; + + if (!n->Children[0]) + return NULL; + + inst = emit(emitInfo, n->Children[0]); if (inst) { /* set inst's CondUpdate flag */ inst->CondUpdate = GL_TRUE; |