aboutsummaryrefslogtreecommitdiff
path: root/testes/memerr.lua
diff options
context:
space:
mode:
authorRoberto I <roberto@inf.puc-rio.br>2025-11-08 11:43:42 -0300
committerRoberto I <roberto@inf.puc-rio.br>2025-11-08 11:43:42 -0300
commite44f3a2ffc7ced5e75cca7657aaa60ef27da89aa (patch)
tree090174ab9a66fbec195e9dd539710ab19370ec2f /testes/memerr.lua
parentf791bb69061c15f73395c5a95958ac18af5ef764 (diff)
downloadlua-e44f3a2ffc7ced5e75cca7657aaa60ef27da89aa.tar.gz
lua-e44f3a2ffc7ced5e75cca7657aaa60ef27da89aa.tar.bz2
lua-e44f3a2ffc7ced5e75cca7657aaa60ef27da89aa.zip
Global initialization checks name conflict
Initialization "global a = 10" raises an error if global 'a' is already defined, that is, it has a non-nil value.
Diffstat (limited to 'testes/memerr.lua')
-rw-r--r--testes/memerr.lua4
1 files changed, 2 insertions, 2 deletions
diff --git a/testes/memerr.lua b/testes/memerr.lua
index 2cc8f481..9c940ca7 100644
--- a/testes/memerr.lua
+++ b/testes/memerr.lua
@@ -166,9 +166,9 @@ local function expand (n,s)
166 e, s, expand(n-1,s), e) 166 e, s, expand(n-1,s), e)
167end 167end
168 168
169G=0; collectgarbage(); a =collectgarbage("count") 169G=0; collectgarbage()
170load(expand(20,"G=G+1"))() 170load(expand(20,"G=G+1"))()
171assert(G==20); collectgarbage(); -- assert(gcinfo() <= a+1) 171assert(G==20); collectgarbage()
172G = nil 172G = nil
173 173
174testamem("running code on new thread", function () 174testamem("running code on new thread", function ()