From 43c8e5bded052801f54a7439d18933b83570eb82 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Mon, 30 Oct 2023 14:25:59 -0300 Subject: Full abstraction for representation of array values --- ltests.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'ltests.c') diff --git a/ltests.c b/ltests.c index 7d184c0d..e2bf76bd 100644 --- a/ltests.c +++ b/ltests.c @@ -362,8 +362,11 @@ static void checktable (global_State *g, Table *h) { Node *n, *limit = gnode(h, sizenode(h)); GCObject *hgc = obj2gco(h); checkobjrefN(g, hgc, h->metatable); - for (i = 0; i < asize; i++) - checkvalref(g, hgc, &h->array[i]); + for (i = 0; i < asize; i++) { + TValue aux; + arr2obj(h, i + 1, &aux); + checkvalref(g, hgc, &aux); + } for (n = gnode(h, 0); n < limit; n++) { if (!isempty(gval(n))) { TValue k; @@ -1005,7 +1008,8 @@ static int table_query (lua_State *L) { } else if ((unsigned int)i < asize) { lua_pushinteger(L, i); - pushobject(L, &t->array[i]); + arr2obj(t, i + 1, s2v(L->top.p)); + api_incr_top(L); lua_pushnil(L); } else if ((i -= asize) < sizenode(t)) { -- cgit v1.2.3-55-g6feb