mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-02-14 17:40:30 +01:00
add NULL ptr check
This commit is contained in:
parent
ccb80d7ec4
commit
15aa7aaa93
1 changed files with 9 additions and 6 deletions
|
|
@ -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]);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue