aboutsummaryrefslogtreecommitdiff
path: root/lvm.c
diff options
context:
space:
mode:
authorRoberto I <roberto@inf.puc-rio.br>2025-08-27 10:30:54 -0300
committerRoberto I <roberto@inf.puc-rio.br>2025-08-27 10:30:54 -0300
commitf87416f1a3e47aa69ed8d27e7406ec6b7848da9a (patch)
tree223c07bf1f2c39ca692f74015b52b8670eb6ad52 /lvm.c
parent03a3473687ef0df86fc6d31de7d46158a0436666 (diff)
downloadlua-f87416f1a3e47aa69ed8d27e7406ec6b7848da9a.tar.gz
lua-f87416f1a3e47aa69ed8d27e7406ec6b7848da9a.tar.bz2
lua-f87416f1a3e47aa69ed8d27e7406ec6b7848da9a.zip
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.
Diffstat (limited to '')
-rw-r--r--lvm.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lvm.c b/lvm.c
index a9de5cbc..d0a1c05d 100644
--- a/lvm.c
+++ b/lvm.c
@@ -1888,7 +1888,7 @@ void luaV_execute (lua_State *L, CallInfo *ci) {
1888 vmcase(OP_SETLIST) { 1888 vmcase(OP_SETLIST) {
1889 StkId ra = RA(i); 1889 StkId ra = RA(i);
1890 unsigned n = cast_uint(GETARG_vB(i)); 1890 unsigned n = cast_uint(GETARG_vB(i));
1891 unsigned int last = cast_uint(GETARG_vC(i)); 1891 unsigned last = cast_uint(GETARG_vC(i));
1892 Table *h = hvalue(s2v(ra)); 1892 Table *h = hvalue(s2v(ra));
1893 if (n == 0) 1893 if (n == 0)
1894 n = cast_uint(L->top.p - ra) - 1; /* get up to the top */ 1894 n = cast_uint(L->top.p - ra) - 1; /* get up to the top */