mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-15 22:58:05 +02:00
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> (cherry picked from commit02b394023b)
This commit is contained in:
parent
ef6f4d897c
commit
b48ac0e29b
2 changed files with 5 additions and 2 deletions
|
|
@ -337,7 +337,7 @@
|
|||
"description": "glsl: fix variable scope for instructions inside case statements",
|
||||
"nominated": true,
|
||||
"nomination_type": 1,
|
||||
"resolution": 0,
|
||||
"resolution": 1,
|
||||
"main_sha": null,
|
||||
"because_sha": "665d75cc5a23f8024034d0c4176fb281f94a30e9"
|
||||
},
|
||||
|
|
|
|||
|
|
@ -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…
Add table
Reference in a new issue