The slang_variable::declared field originated as a debug field but can be promoted for use during sematic error checking. Fixes fd.o bug 27921. NOTE: this is a candidate for back-porting to the 7.8 stable branch.undefined
slang_atom name = oper->var ? oper->var->a_name : oper->a_id; | slang_atom name = oper->var ? oper->var->a_name : oper->a_id; | ||||
slang_variable *var = _slang_variable_locate(oper->locals, name, GL_TRUE); | slang_variable *var = _slang_variable_locate(oper->locals, name, GL_TRUE); | ||||
slang_ir_node *n; | slang_ir_node *n; | ||||
if (!var) { | |||||
if (!var || !var->declared) { | |||||
slang_info_log_error(A->log, "undefined variable '%s'", (char *) name); | slang_info_log_error(A->log, "undefined variable '%s'", (char *) name); | ||||
return NULL; | return NULL; | ||||
} | } | ||||
assert(var->declared); | |||||
n = new_var(A, var); | n = new_var(A, var); | ||||
return n; | return n; | ||||
} | } |
GLuint size; /**< Variable's size in bytes */ | GLuint size; /**< Variable's size in bytes */ | ||||
GLboolean is_global; | GLboolean is_global; | ||||
GLboolean isTemp; /**< a named temporary (__resultTmp) */ | GLboolean isTemp; /**< a named temporary (__resultTmp) */ | ||||
GLboolean declared; /**< for debug */ | |||||
GLboolean declared; /**< has the var been declared? */ | |||||
struct slang_ir_storage_ *store; /**< Storage for this var */ | struct slang_ir_storage_ *store; /**< Storage for this var */ | ||||
} slang_variable; | } slang_variable; | ||||