summaryrefslogtreecommitdiff
path: root/src/glsl/ast_to_hir.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/glsl/ast_to_hir.cpp')
-rw-r--r--src/glsl/ast_to_hir.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/glsl/ast_to_hir.cpp b/src/glsl/ast_to_hir.cpp
index 6e5d01ee26..bd1ab78d4a 100644
--- a/src/glsl/ast_to_hir.cpp
+++ b/src/glsl/ast_to_hir.cpp
@@ -2395,11 +2395,17 @@ ast_selection_statement::hir(exec_list *instructions,
ir_if *const stmt = new(ctx) ir_if(condition);
- if (then_statement != NULL)
+ if (then_statement != NULL) {
+ state->symbols->push_scope();
then_statement->hir(& stmt->then_instructions, state);
+ state->symbols->pop_scope();
+ }
- if (else_statement != NULL)
+ if (else_statement != NULL) {
+ state->symbols->push_scope();
else_statement->hir(& stmt->else_instructions, state);
+ state->symbols->pop_scope();
+ }
instructions->push_tail(stmt);