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

Andrey Dobrovolsky <[email protected]> Fri, 17 Jul 2026 23:12:16 +0300
Newsgroups gmane.comp.lang.lua.general
Message-ID <CAN5FJ7dO0hw1Adgi-RqLjRfj3JB9J4S98hcOdGtP3oZSCBa+wA@mail.gmail.com>
Hi Martin,

> For example "local f =3D function() end; return f;":

it seems to me that this source code already includes unreachable
code. Should code generator provide code analyser's functionality?

Regards,
-- Andrew


=D0=BF=D1=82, 17 =D0=BB=D0=B8=D0=BF. 2026=E2=80=AF=D1=80. =D0=BE 22:38 'Mar=
tin Eden' via lua-l
<[email protected]> =D0=BF=D0=B8=D1=88=D0=B5:
>
> On 2026-07-15 22:53, Luiz Henrique de Figueiredo wrote:
> > Lua 5.5.1 (rc1) is now available for testing at
> > https://www.lua.org/work/lua-5.5.1-rc1.tar.gz
>
> Congratulations with release! (I still admire your admittance of bugs.)
>
> Lua 5.5.1 (as many previous versions) sometimes produces bytecode
> with unreachable instructions. (At least I don't understand
> how they can be reached.)
>
> For example "local f =3D function() end; return f;":
>
>    > $ echo 'local f =3D function() end; return f;' | luac -p -l -s -
>    >
>    > main <stdin:0,0> (4 instructions at 0x5626f1974b30)
>    > 0+ params, 2 slots, 1 upvalue, 1 local, 0 constants, 1 function
>    >   1 [1] VARARGPREP  0
>    >   2 [1] CLOSURE   0 0 ; 0x5626f1974e20
>    >   3 [1] RETURN    0 2 1 ; 1 out
>    >   4 [1] RETURN    1 1 1 ; 0 out
>    >
>    > function <stdin:1,1> (1 instruction at 0x5626f1974e20)
>    > 0 params, 2 slots, 0 upvalues, 0 locals, 0 constants, 0 functions
>    >   1 [1] RETURN0
>    >
>
> "RETURN 1 1 1" looks unreachable and dead code.
>
> (I understand that's code generation quirk and code generation
> is not simple thing.)
>
> I hope dead bytecode will be reduced in future Lua versions.
>
> -- Martin
>
>
> --
> 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=
 email to [email protected].
> To view this discussion visit https://groups.google.com/d/msgid/lua-l/7a3=
bc6d6-84e5-445d-80f4-d0c800aab0c8%40disroot.org.

--=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/CAN5F=
J7dO0hw1Adgi-RqLjRfj3JB9J4S98hcOdGtP3oZSCBa%2BwA%40mail.gmail.com.