summaryrefslogtreecommitdiff
path: root/ast_to_hir.cpp
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2010-03-31 15:44:38 -1000
committerIan Romanick <ian.d.romanick@intel.com>2010-04-02 11:05:16 -0700
commitac3af37d27c49704dd3b2d303b4497b08f8b47fd (patch)
treea1ce516d4c0e985e24cda4b235d7bbf16e6e2d7f /ast_to_hir.cpp
parent068c80cfe0a280490353b6b007165d717c672eed (diff)
Allow initializers of constant values to succeed.
This regresses constFunc.frag, but that's just unexpectedly passing because of the FINISHME just above.
Diffstat (limited to 'ast_to_hir.cpp')
-rw-r--r--ast_to_hir.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/ast_to_hir.cpp b/ast_to_hir.cpp
index 137abdaaa6..11000a8134 100644
--- a/ast_to_hir.cpp
+++ b/ast_to_hir.cpp
@@ -1441,8 +1441,12 @@ ast_declarator_list::hir(exec_list *instructions,
*/
if (!rhs->type->is_error()) {
+ bool temp = var->read_only;
+ if (this->type->qualifier.constant)
+ var->read_only = false;
(void) do_assignment(instructions, state, lhs, rhs,
this->get_location());
+ var->read_only = temp;
}
}