diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2024-03-11 14:05:06 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2024-03-11 14:05:06 -0300 |
commit | 65b07dd53d7938a60112fc4473f5cad3473e3534 (patch) | |
tree | 469c75dba3b194c494b6ad6a30ca44e7e8354ef5 /testes | |
parent | 7237eb3f1c480d6bc7fe2832ddd36f2137fb69d9 (diff) | |
download | lua-65b07dd53d7938a60112fc4473f5cad3473e3534.tar.gz lua-65b07dd53d7938a60112fc4473f5cad3473e3534.tar.bz2 lua-65b07dd53d7938a60112fc4473f5cad3473e3534.zip |
API asserts for illegal pops of to-be-closed variables
Diffstat (limited to 'testes')
-rw-r--r-- | testes/api.lua | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/testes/api.lua b/testes/api.lua index eec9c0ab..dc485240 100644 --- a/testes/api.lua +++ b/testes/api.lua | |||
@@ -1193,7 +1193,8 @@ do | |||
1193 | local a, b = pcall(T.makeCfunc[[ | 1193 | local a, b = pcall(T.makeCfunc[[ |
1194 | call 0 1 # create resource | 1194 | call 0 1 # create resource |
1195 | toclose -1 # mark it to be closed | 1195 | toclose -1 # mark it to be closed |
1196 | error # resource is the error object | 1196 | pushvalue -1 # replicate it as error object |
1197 | error # resource right after error object | ||
1197 | ]], newresource) | 1198 | ]], newresource) |
1198 | assert(a == false and b[1] == 11) | 1199 | assert(a == false and b[1] == 11) |
1199 | assert(#openresource == 0) -- was closed | 1200 | assert(#openresource == 0) -- was closed |