Allow initializers of constant values to succeed.
authorEric Anholt <eric@anholt.net>
Thu, 1 Apr 2010 01:44:38 +0000 (15:44 -1000)
committerIan Romanick <ian.d.romanick@intel.com>
Fri, 2 Apr 2010 18:05:16 +0000 (11:05 -0700)
This regresses constFunc.frag, but that's just unexpectedly passing
because of the FINISHME just above.

ast_to_hir.cpp

index 137abda..11000a8 100644 (file)
@@ -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;
         }
       }