Added limit to number of elements in a constructor

The reasoning in commit 519c57d5 is wrong: A sequence of nils generates
several fields with just one OP_LOADNIL.
This commit is contained in:
Roberto I
2025-08-27 10:30:54 -03:00
parent 03a3473687
commit f87416f1a3
2 changed files with 19 additions and 4 deletions

2
lvm.c
View File

@@ -1888,7 +1888,7 @@ void luaV_execute (lua_State *L, CallInfo *ci) {
vmcase(OP_SETLIST) {
StkId ra = RA(i);
unsigned n = cast_uint(GETARG_vB(i));
unsigned int last = cast_uint(GETARG_vC(i));
unsigned last = cast_uint(GETARG_vC(i));
Table *h = hvalue(s2v(ra));
if (n == 0)
n = cast_uint(L->top.p - ra) - 1; /* get up to the top */