]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
compiler: fix ICE in handling of rune constants.
authorian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 7 May 2012 18:36:36 +0000 (18:36 +0000)
committerian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 7 May 2012 18:36:36 +0000 (18:36 +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/trunk@187264 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/go/gofrontend/expressions.cc

index 39824bfcb6f8cac4dce6de4d29c595c44d901063..f6fb65866f00e5441713fdf50da03f3a680e1c5a 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);