diff options
author | Brian <[email protected]> | 2007-03-11 17:29:54 -0600 |
---|---|---|
committer | Brian <[email protected]> | 2007-03-11 17:29:54 -0600 |
commit | 15aa7aaa9327f528d1edc47d76fcc92e32bf001e (patch) | |
tree | 5a4ea728daf5d4031875dbbed70ca60e9ffe6c92 | |
parent | ccb80d7ec4e4415c5443031ec26447117e20e4de (diff) |
add NULL ptr check
-rw-r--r-- | src/mesa/shader/slang/slang_codegen.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/src/mesa/shader/slang/slang_codegen.c b/src/mesa/shader/slang/slang_codegen.c index 88a4b2d6578..7b2ca3a437e 100644 --- a/src/mesa/shader/slang/slang_codegen.c +++ b/src/mesa/shader/slang/slang_codegen.c @@ -1985,12 +1985,15 @@ _slang_gen_assignment(slang_assemble_ctx * A, slang_operation *oper) else { slang_ir_node *n, *lhs, *rhs; lhs = _slang_gen_operation(A, &oper->children[0]); - if (lhs->Store->File != PROGRAM_OUTPUT && - lhs->Store->File != PROGRAM_TEMPORARY && - lhs->Store->File != PROGRAM_VARYING && - lhs->Store->File != PROGRAM_UNDEFINED) { - slang_info_log_error(A->log, "Assignment to read-only variable"); - return NULL; + + if (lhs) { + if (lhs->Store->File != PROGRAM_OUTPUT && + lhs->Store->File != PROGRAM_TEMPORARY && + lhs->Store->File != PROGRAM_VARYING && + lhs->Store->File != PROGRAM_UNDEFINED) { + slang_info_log_error(A->log, "Assignment to read-only variable"); + return NULL; + } } rhs = _slang_gen_operation(A, &oper->children[1]); |