summaryrefslogtreecommitdiff
path: root/ast_to_hir.cpp
diff options
context:
space:
mode:
authorIan Romanick <ian.d.romanick@intel.com>2010-04-16 16:42:43 -0700
committerIan Romanick <ian.d.romanick@intel.com>2010-04-16 16:42:43 -0700
commit484606610e36ec7598f7733e9787d888b6a63d64 (patch)
tree3ccedabfd6a7b6c72e13066fa8f1c7036ab99630 /ast_to_hir.cpp
parent44b694e1f621730bca1cd03eabdfe5474d818f18 (diff)
While-loops also start a new scope.
Diffstat (limited to 'ast_to_hir.cpp')
-rw-r--r--ast_to_hir.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/ast_to_hir.cpp b/ast_to_hir.cpp
index e89b3ff..83dac58 100644
--- a/ast_to_hir.cpp
+++ b/ast_to_hir.cpp
@@ -2284,9 +2284,9 @@ ir_rvalue *
ast_iteration_statement::hir(exec_list *instructions,
struct _mesa_glsl_parse_state *state)
{
- /* For loops start a new scope, but while and do-while loops do not.
+ /* For-loops and while-loops start a new scope, but do-while loops do not.
*/
- if (mode == ast_for)
+ if (mode != ast_do_while)
state->symbols->push_scope();
if (init_statement != NULL)
@@ -2317,7 +2317,7 @@ ast_iteration_statement::hir(exec_list *instructions,
if (mode == ast_do_while)
condition_to_hir(stmt, state);
- if (mode == ast_for)
+ if (mode != ast_do_while)
state->symbols->pop_scope();
/* Restore previous nesting before returning.