Re: Subject: [ANN] Lua 5.5.1 (rc1) now available

Christophe Delord <[email protected]> Thu, 16 Jul 2026 07:38:12 +0200
Newsgroups gmane.comp.lang.lua.general
Message-ID <[email protected]>
Le 16/07/2026 =C3=A0 06:45, Christophe Delord a =C3=A9crit=C2=A0:
> Le 16/07/2026 =C3=A0 00:29, Luiz Henrique de Figueiredo a =C3=A9crit=C2=
=A0:
>>> Lua 5.5.1-rc1 passes all LuaX tests but there are some undefined=20
>>> behaviours detected by UBSan.
>> Are these undefined behaviours absent in Lua 5.5.0?
>> --lhf
> There are no such undefined behaviours in Lua 5.5.0.
>
Here is a patch in lstate.h that seems to fix these UBs:


/*
** Type used only to capture, via 'LUAI_MAXALIGN' (see luaconf.h), the
** strictest alignment that Lua objects may require (e.g., because
** 'struct Udata' embeds 'LUAI_MAXALIGN' and is itself a member of
** 'union GCUnion'). Used below to keep 'LX.l' correctly aligned.
*/
typedef union { LUAI_MAXALIGN; } L_Umaxalign;

#define MAX(a, b) ((a) > (b) ? (a) : (b))

/*
** thread state + extra space
*/
typedef struct LX {
 =C2=A0 lu_byte extra_[MAX(LUA_EXTRASPACE, sizeof(L_Umaxalign))];
 =C2=A0 lua_State l;
} LX;



--=20
You received this message because you are subscribed to the Google Groups "=
lua-l" group.
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to [email protected].
To view this discussion visit https://groups.google.com/d/msgid/lua-l/e6ff2=
171-3d88-4860-bc90-72188c3ebde1%40cdelord.fr.