[PATCH, libiberty] Fix segfault in floatformat.c:get_field on 64-bit hosts
Julian Brown
julian@codesourcery.com
Thu Jun 15 22:46:00 GMT 2006
Hi,
Ian Lance Taylor wrote:
>>>Please compile the file as a standalone program with -DIEEE_DEBUG to
>>>make sure those tests still work. Ideally on both a big- and
>>>little-endian system, if possible.
I've done this (with a new put_field too), though the IEEE_DEBUG test
needs explicitly changing to use floatformat_ieee_double_big not
floatformat_ieee_double_little on a big-endian host, which wasn't
immediately obvious...
> This patch is OK with that change, assuming the tests pass.
>
> Bonus points if you rewrite put_field.
"put_field" indeed crashed too on x86_64 with IEEE_DEBUG defined, so
I've rewritten it in a similar style. Just to be sure, is this still OK
(for gcc and/or binutils)?
Cheers,
Julian
ChangeLog (libiberty):
* floatformat.c (get_field): Fix segfault with little-endian word
order on 64-bit hosts.
(put_field): Likewise.
(min): Move definition.
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: libiberty-getfield-5
URL: <https://sourceware.org/pipermail/binutils/attachments/20060615/11732569/attachment.ksh>
More information about the Binutils
mailing list