lua-users home
lua-l archive

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


Disasm might be nice of the relevant section

On Wed, Jul 1, 2020, 19:58 Pierre Chapuis <catwell@archlinux.us> wrote:
On Wed, Jul 1, 2020, at 18:42, Roberto Ierusalimschy wrote:
> > Doing this prevents the crash (!)
> >
> >     --- src/lobject.old.c   2020-07-01 16:35:34.525256170 +0200
> >     +++ src/lobject.c   2020-07-01 16:34:38.293400900 +0200
> >     @@ -346,6 +346,7 @@
> >        if (ttisinteger(obj))
> >          len = lua_integer2str(buff, MAXNUMBER2STR, ivalue(obj));
> >        else {
> >     +    fprintf(stderr, "%p\n", buff);
> >          len = lua_number2str(buff, MAXNUMBER2STR, fltvalue(obj));
> >          if (buff[strspn(buff, "-0123456789")] == '\0') {  /* looks like an int? */
> >            buff[len++] = lua_getlocaledecpoint();
>
> If you add this print in 'addnum2buff' instead, does the crash also
> disapear?

No. It prints something (e.g. 0x7ffdb5514fb0) and then it crashes.