Re: Subject: [ANN] Lua 5.5.1 (rc1) now available
Christophe Delord <[email protected]> Thu, 16 Jul 2026 07:56:29 +0200
| Newsgroups | gmane.comp.lang.lua.general |
|---|---|
| Message-ID | <[email protected]> |
Le 16/07/2026 =C3=A0 07:38, Christophe Delord a =C3=A9crit=C2=A0:
>
> 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;
>
or :
/*
** thread state + extra space + alignment
*/
typedef struct LX {
=C2=A0 lu_byte extra_[LUA_EXTRASPACE];
=C2=A0 union {
=C2=A0 =C2=A0 union { LUAI_MAXALIGN; } dummy_align_;
=C2=A0 =C2=A0 lua_State l;
=C2=A0 };
} 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/42b17=
296-b5b9-4372-a937-7d8ed04649de%40cdelord.fr.