OSDN Git Service

compiler: fix ICE in handling of rune constants.
authorian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 7 May 2012 18:37:00 +0000 (18:37 +0000)
committerian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 7 May 2012 18:37:00 +0000 (18:37 +0000)
This patch corrects an ICE in handling on constant expressions
such as

const r = ^'a'

Part of issue 9.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-4_7-branch@187265 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/go/gofrontend/expressions.cc

index 39824bf..f6fb658 100644 (file)
@@ -3712,7 +3712,10 @@ Unary_expression::eval_constant(Operator op, const Numeric_constant* unc,
     return false;
 
   mpz_t uval;
-  unc->get_int(&uval);
+  if (unc->is_rune())
+    unc->get_rune(&uval);
+  else
+    unc->get_int(&uval);
   mpz_t val;
   mpz_init(val);