From: Simon Marchi <simon.marchi@polymtl.ca>
To: Ulrich Weigand <uweigand@de.ibm.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [RFC][02/19] Target FP: Simplify floatformat_from_type
Date: Sun, 17 Sep 2017 15:29:00 -0000 [thread overview]
Message-ID: <415dd56ab341198fd691755ba80ce8e0@polymtl.ca> (raw)
In-Reply-To: <20170905182040.13FE8D8086F@oc3748833570.ibm.com>
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
next prev parent reply other threads:[~2017-09-17 15:29 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-09-05 18:20 Ulrich Weigand
2017-09-17 15:29 ` Simon Marchi [this message]
2017-09-18 11:49 ` Ulrich Weigand
2017-09-18 16:21 ` Simon Marchi
2017-09-18 19:01 ` Ulrich Weigand
2017-09-20 16:30 ` Ulrich Weigand
2017-09-27 17:08 ` Ulrich Weigand
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=415dd56ab341198fd691755ba80ce8e0@polymtl.ca \
--to=simon.marchi@polymtl.ca \
--cc=gdb-patches@sourceware.org \
--cc=uweigand@de.ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox