[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [bug-gawk] Bug in gawk big num
From: |
arnold |
Subject: |
Re: [bug-gawk] Bug in gawk big num |
Date: |
Wed, 26 Sep 2018 08:11:26 -0600 |
User-agent: |
Heirloom mailx 12.4 7/29/08 |
"Andrew J. Schorr" <address@hidden> wrote:
> On Wed, Sep 26, 2018 at 09:40:49AM -0400, Andrew J. Schorr wrote:
> > I think the bug is in mpfr.c:mpg_maybe_float in this section:
> >
> > for (; *s != '\0'; s++) {
> > if (*s == dec_point || *s == 'e' || *s == 'E')
> > return true;
> > }
> >
> > If the hex string contains the letter 'E', it decides that it might be a
> > floating point number and ends up calling mpfr_strtofr instead
> > of mpg_strtoui.
>
> The attached patch seems to work, but I'm not sure whether this is
> the ideal fix.
>
> Arnold -- please take a look.
>
> Regards,
> Andy
I think you have to check `base == 10' since base could also be 8.
In mpfr_force_num we may have to call get_numbase unconditionally
in order to recognize that we have a hex value.
This begs the larger question of how -v n=0x... should be treated.
I need to spend some time on this with a debugger and think it through
some more.
Thanks,
Arnold
Re: [bug-gawk] Bug in gawk big num, arnold, 2018/09/26
Re: [bug-gawk] Bug in gawk big num, arnold, 2018/09/27