From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 99677 invoked by alias); 17 Sep 2017 15:29:52 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 99668 invoked by uid 89); 17 Sep 2017 15:29:51 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-11.4 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_2,GIT_PATCH_3,RP_MATCHES_RCVD,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 spammy=HTo:U*uweigand, funny, 273531 X-HELO: smtp.polymtl.ca Received: from smtp.polymtl.ca (HELO smtp.polymtl.ca) (132.207.4.11) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sun, 17 Sep 2017 15:29:50 +0000 Received: from simark.ca (simark.ca [158.69.221.121]) (authenticated bits=0) by smtp.polymtl.ca (8.14.7/8.14.7) with ESMTP id v8HFThJ7022391 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Sun, 17 Sep 2017 11:29:47 -0400 Received: by simark.ca (Postfix, from userid 112) id F08FF1ECF0; Sun, 17 Sep 2017 11:29:42 -0400 (EDT) Received: from simark.ca (localhost [127.0.0.1]) by simark.ca (Postfix) with ESMTP id D01C31EA1D; Sun, 17 Sep 2017 11:29:41 -0400 (EDT) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Sun, 17 Sep 2017 15:29:00 -0000 From: Simon Marchi To: Ulrich Weigand Cc: gdb-patches@sourceware.org Subject: Re: [RFC][02/19] Target FP: Simplify floatformat_from_type In-Reply-To: <20170905182040.13FE8D8086F@oc3748833570.ibm.com> References: <20170905182040.13FE8D8086F@oc3748833570.ibm.com> Message-ID: <415dd56ab341198fd691755ba80ce8e0@polymtl.ca> X-Sender: simon.marchi@polymtl.ca User-Agent: Roundcube Webmail/1.3.0 X-Poly-FromMTA: (simark.ca [158.69.221.121]) at Sun, 17 Sep 2017 15:29:43 +0000 X-IsSubscribed: yes X-SW-Source: 2017-09/txt/msg00438.txt.bz2 On 2017-09-05 20:20, Ulrich Weigand wrote: > Index: binutils-gdb/gdb/gdbtypes.c > =================================================================== > --- binutils-gdb.orig/gdb/gdbtypes.c > +++ binutils-gdb/gdb/gdbtypes.c > @@ -2735,22 +2735,31 @@ set_type_code (struct type *type, enum t > determined by the floatformat. Returns size to be used. */ > > static int > -verify_floatformat (int bit, const struct floatformat **floatformats) > +verify_floatformat (int bit, const struct floatformat *floatformat) > { > - gdb_assert (floatformats != NULL); > - gdb_assert (floatformats[0] != NULL && floatformats[1] != NULL); > + gdb_assert (floatformat != NULL); > > if (bit == -1) > - bit = floatformats[0]->totalsize; > + bit = floatformat->totalsize; > gdb_assert (bit >= 0); > > size_t len = bit / TARGET_CHAR_BIT; > - gdb_assert (len >= floatformat_totalsize_bytes (floatformats[0])); > - gdb_assert (len >= floatformat_totalsize_bytes (floatformats[1])); > + gdb_assert (len * TARGET_CHAR_BIT >= floatformat->totalsize); That looks funny now. Is there a reason not to do gdb_assert (bit >= floatformat->totalsize); directly? Simon