aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/mesa/shader/slang/slang_codegen.c
diff options
context:
space:
mode:
Diffstat (limited to 'mesalib/src/mesa/shader/slang/slang_codegen.c')
-rw-r--r--mesalib/src/mesa/shader/slang/slang_codegen.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/mesalib/src/mesa/shader/slang/slang_codegen.c b/mesalib/src/mesa/shader/slang/slang_codegen.c
index ecb2f6d5c..7d5e5eb29 100644
--- a/mesalib/src/mesa/shader/slang/slang_codegen.c
+++ b/mesalib/src/mesa/shader/slang/slang_codegen.c
@@ -4187,11 +4187,10 @@ _slang_gen_variable(slang_assemble_ctx * A, slang_operation *oper)
slang_atom name = oper->var ? oper->var->a_name : oper->a_id;
slang_variable *var = _slang_variable_locate(oper->locals, name, GL_TRUE);
slang_ir_node *n;
- if (!var) {
+ if (!var || !var->declared) {
slang_info_log_error(A->log, "undefined variable '%s'", (char *) name);
return NULL;
}
- assert(var->declared);
n = new_var(A, var);
return n;
}