diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2023-11-07 17:26:15 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2023-11-07 17:26:15 -0300 |
commit | 37c215b43f27a1c41e8a920987e1c3bd7b34330d (patch) | |
tree | f14f4417384cffb9d2e5ef3c09621555a5d1e9a2 /ltests.c | |
parent | 9e99f3071d07767f9e882c4abf3537f75ce2d161 (diff) | |
parent | fa075b79530af1cbc977349f2e467d69ce01202c (diff) | |
download | lua-37c215b43f27a1c41e8a920987e1c3bd7b34330d.tar.gz lua-37c215b43f27a1c41e8a920987e1c3bd7b34330d.tar.bz2 lua-37c215b43f27a1c41e8a920987e1c3bd7b34330d.zip |
Merge branch 'newarray' into nextversion
Diffstat (limited to 'ltests.c')
-rw-r--r-- | ltests.c | 10 |
1 files changed, 7 insertions, 3 deletions
@@ -362,8 +362,11 @@ static void checktable (global_State *g, Table *h) { | |||
362 | Node *n, *limit = gnode(h, sizenode(h)); | 362 | Node *n, *limit = gnode(h, sizenode(h)); |
363 | GCObject *hgc = obj2gco(h); | 363 | GCObject *hgc = obj2gco(h); |
364 | checkobjrefN(g, hgc, h->metatable); | 364 | checkobjrefN(g, hgc, h->metatable); |
365 | for (i = 0; i < asize; i++) | 365 | for (i = 0; i < asize; i++) { |
366 | checkvalref(g, hgc, &h->array[i]); | 366 | TValue aux; |
367 | arr2obj(h, i + 1, &aux); | ||
368 | checkvalref(g, hgc, &aux); | ||
369 | } | ||
367 | for (n = gnode(h, 0); n < limit; n++) { | 370 | for (n = gnode(h, 0); n < limit; n++) { |
368 | if (!isempty(gval(n))) { | 371 | if (!isempty(gval(n))) { |
369 | TValue k; | 372 | TValue k; |
@@ -1004,7 +1007,8 @@ static int table_query (lua_State *L) { | |||
1004 | } | 1007 | } |
1005 | else if ((unsigned int)i < asize) { | 1008 | else if ((unsigned int)i < asize) { |
1006 | lua_pushinteger(L, i); | 1009 | lua_pushinteger(L, i); |
1007 | pushobject(L, &t->array[i]); | 1010 | arr2obj(t, i + 1, s2v(L->top.p)); |
1011 | api_incr_top(L); | ||
1008 | lua_pushnil(L); | 1012 | lua_pushnil(L); |
1009 | } | 1013 | } |
1010 | else if ((i -= asize) < sizenode(t)) { | 1014 | else if ((i -= asize) < sizenode(t)) { |