compiler: fix ICE in handling of rune constants.

This patch corrects an ICE in handling on constant expressions
such as

const r = ^'a'

Part of issue 9.

From-SVN: r187265
This commit is contained in:
Ian Lance Taylor 2012-05-07 18:37:00 +00:00
parent 69bc1c3c53
commit 962cc4d5db
1 changed files with 4 additions and 1 deletions

View 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);