lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On Thu, Jul 2, 2020 at 1:35 PM Roberto Ierusalimschy
<roberto@inf.puc-rio.br> wrote:
>
> > > I am afraid I didn't ask what I wanted :-)  What I meant was to print
> > > the value of 'numbuff' in 'addnum2buff' (not 'buff'); that is the value
> > > that becomes 'buff' in 'tostringbuff'. Better still if you could print
> > > both values ('numbuff' and 'buff' in 'addnum2buff').
> >
> > [lua-5.4.0 08:07] ./src/lua -e "tostring(1.0)"
> > buff: 0x7ffe557f6140, numbuff: 0x7ffe557f6150
> > Bus error (core dumped)
>
> Thanks.
>
> That is one more point in favor of a compiler bug. After this print,
> numbuff is simply passed as an argument to tostringbuff, and suddenly
> its value changes from 0x7ffe557f6150 (or 0x7fffffffd850, in the trace
> you sent earlier) to 0x3ff0000000000000.
>
> -- Roberto

Looks like a compiler bug to me too. Here's a minimized example:
https://godbolt.org/z/RMc3RX

I reported it to GCC's bug tracker:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96040

Joseph C. Sible