aboutsummaryrefslogtreecommitdiff
path: root/testes/code.lua
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2019-07-12 16:13:50 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2019-07-12 16:13:50 -0300
commit1fb4d539254b67e7e35ed698250c66d1edff0e08 (patch)
tree8f48b7ca736a7fb02834bcfac1415cd43307f529 /testes/code.lua
parentf6aab3ec1f111cd8d968bdcb7ca800e93b819d24 (diff)
downloadlua-1fb4d539254b67e7e35ed698250c66d1edff0e08.tar.gz
lua-1fb4d539254b67e7e35ed698250c66d1edff0e08.tar.bz2
lua-1fb4d539254b67e7e35ed698250c66d1edff0e08.zip
OP_NEWTABLE keeps exact size of arrays
OP_NEWTABLE is followed by an OP_EXTRAARG, so that it can keep the exact size of the array part of the table to be created. (Functions 'luaO_int2fb'/'luaO_fb2int' were removed.)
Diffstat (limited to 'testes/code.lua')
-rw-r--r--testes/code.lua6
1 files changed, 4 insertions, 2 deletions
diff --git a/testes/code.lua b/testes/code.lua
index 49d682f8..b2702c61 100644
--- a/testes/code.lua
+++ b/testes/code.lua
@@ -93,11 +93,13 @@ end
93-- some basic instructions 93-- some basic instructions
94check(function () -- function does not create upvalues 94check(function () -- function does not create upvalues
95 (function () end){f()} 95 (function () end){f()}
96end, 'CLOSURE', 'NEWTABLE', 'GETTABUP', 'CALL', 'SETLIST', 'CALL', 'RETURN0') 96end, 'CLOSURE', 'NEWTABLE', 'EXTRAARG', 'GETTABUP', 'CALL',
97 'SETLIST', 'CALL', 'RETURN0')
97 98
98check(function (x) -- function creates upvalues 99check(function (x) -- function creates upvalues
99 (function () return x end){f()} 100 (function () return x end){f()}
100end, 'CLOSURE', 'NEWTABLE', 'GETTABUP', 'CALL', 'SETLIST', 'CALL', 'RETURN') 101end, 'CLOSURE', 'NEWTABLE', 'EXTRAARG', 'GETTABUP', 'CALL',
102 'SETLIST', 'CALL', 'RETURN')
101 103
102 104
103-- sequence of LOADNILs 105-- sequence of LOADNILs