summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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;
}
}