Don't crash calling make with NaN or Infinity.
authorIan Lance Taylor <ian@gcc.gnu.org>
Thu, 3 Mar 2011 06:18:55 +0000 (06:18 +0000)
committerIan Lance Taylor <ian@gcc.gnu.org>
Thu, 3 Mar 2011 06:18:55 +0000 (06:18 +0000)
From-SVN: r170644

gcc/go/gofrontend/types.cc

index 04b0bec7ac0e80d17e49e5524219687af2e8a078..27104081df41628ace51ccb06ce5a058046a480c 100644 (file)
@@ -769,7 +769,7 @@ Type::check_int_value(Expression* e, const char* errmsg,
   mpfr_init(fval);
 
   Type* dummy;
-  if (e->float_constant_value(fval, &dummy))
+  if (e->float_constant_value(fval, &dummy) && mpfr_integer_p(fval))
     {
       mpz_t ival;
       mpz_init(ival);