From patchwork Thu Mar 3 06:18:57 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Lance Taylor X-Patchwork-Id: 85234 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id DF8E5B70EA for ; Thu, 3 Mar 2011 17:19:16 +1100 (EST) Received: (qmail 31581 invoked by alias); 3 Mar 2011 06:19:14 -0000 Received: (qmail 31570 invoked by uid 22791); 3 Mar 2011 06:19:14 -0000 X-SWARE-Spam-Status: No, hits=-2.3 required=5.0 tests=AWL, BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, SPF_HELO_PASS, T_RP_MATCHES_RCVD, T_TVD_MIME_NO_HEADERS X-Spam-Check-By: sourceware.org Received: from smtp-out.google.com (HELO smtp-out.google.com) (74.125.121.67) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 03 Mar 2011 06:19:08 +0000 Received: from kpbe18.cbf.corp.google.com (kpbe18.cbf.corp.google.com [172.25.105.82]) by smtp-out.google.com with ESMTP id p236J4eh025402 for ; Wed, 2 Mar 2011 22:19:05 -0800 Received: from iyj8 (iyj8.prod.google.com [10.241.51.72]) by kpbe18.cbf.corp.google.com with ESMTP id p236IZ3V032363 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=NOT) for ; Wed, 2 Mar 2011 22:19:03 -0800 Received: by iyj8 with SMTP id 8so805394iyj.23 for ; Wed, 02 Mar 2011 22:19:03 -0800 (PST) Received: by 10.231.199.212 with SMTP id et20mr655250ibb.22.1299133143050; Wed, 02 Mar 2011 22:19:03 -0800 (PST) Received: from coign.google.com ([216.239.45.130]) by mx.google.com with ESMTPS id d10sm627578ibb.12.2011.03.02.22.19.00 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 02 Mar 2011 22:19:01 -0800 (PST) From: Ian Lance Taylor To: gcc-patches@gcc.gnu.org, gofrontend-dev@googlegroups.com Subject: Go patch committed: Don't crash calling make with NaN or Infinity. Date: Wed, 02 Mar 2011 22:18:57 -0800 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) MIME-Version: 1.0 X-System-Of-Record: true X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org This patch to the Go frontend avoids crashing if the predeclared make function is called with a size which is NaN or Infinity. Bootstrapped and ran Go testsuite on x86_64-unknown-linux-gnu. Committed to mainline. Ian diff -r e973d2893617 go/types.cc --- a/go/types.cc Wed Mar 02 20:26:39 2011 -0800 +++ b/go/types.cc Wed Mar 02 22:15:05 2011 -0800 @@ -769,7 +769,7 @@ 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);