projects
/
mesa.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
cf37ba3
)
glsl: Fix scoping bug in if statements.
author
Kenneth Graunke
<kenneth@whitecape.org>
Wed, 18 Aug 2010 20:54:50 +0000
(13:54 -0700)
committer
Kenneth Graunke
<kenneth@whitecape.org>
Wed, 18 Aug 2010 21:03:25 +0000
(14:03 -0700)
Fixes glslparsertest/glsl2/scoping-01.frag (successfully compiled but
should've failed) and scoping-02.frag (assertion triggered).
src/glsl/ast_to_hir.cpp
patch
|
blob
|
history
diff --git
a/src/glsl/ast_to_hir.cpp
b/src/glsl/ast_to_hir.cpp
index 6e5d01ee265dc197594193ce7257429cafa5ced2..bd1ab78d4aa0c91754343d4c32d8450e545ce0c6 100644
(file)
--- 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);