glsl: fix variable scope for instructions inside case statements
Fixes: 665d75cc5a
("glsl: Fix scoping bug in if statements.")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/5247
Reviewed-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12435>
This commit is contained in:
parent
067599f8bc
commit
02b394023b
|
@ -6830,8 +6830,11 @@ ir_rvalue *
|
|||
ast_switch_body::hir(exec_list *instructions,
|
||||
struct _mesa_glsl_parse_state *state)
|
||||
{
|
||||
if (stmts != NULL)
|
||||
if (stmts != NULL) {
|
||||
state->symbols->push_scope();
|
||||
stmts->hir(instructions, state);
|
||||
state->symbols->pop_scope();
|
||||
}
|
||||
|
||||
/* Switch bodies do not have r-values. */
|
||||
return NULL;
|
||||
|
|
Loading…
Reference in New Issue