diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2024-06-12 16:02:01 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2024-06-12 16:02:01 -0300 |
commit | b529aefc531276775f8827052d5594749232cf07 (patch) | |
tree | 722379af2da40ede4e8c46f1f5edfa0b7d606a58 /testes | |
parent | d51022bf9e496ae4a7276b600d2755becc7d4323 (diff) | |
download | lua-b529aefc531276775f8827052d5594749232cf07.tar.gz lua-b529aefc531276775f8827052d5594749232cf07.tar.bz2 lua-b529aefc531276775f8827052d5594749232cf07.zip |
Bug: luaL_traceback may need more than 5 stack slots
Diffstat (limited to 'testes')
-rw-r--r-- | testes/errors.lua | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/testes/errors.lua b/testes/errors.lua index 01cfe906..80d91a92 100644 --- a/testes/errors.lua +++ b/testes/errors.lua | |||
@@ -91,7 +91,7 @@ end | |||
91 | 91 | ||
92 | if not T then | 92 | if not T then |
93 | (Message or print) | 93 | (Message or print) |
94 | ('\n >>> testC not active: skipping memory message test <<<\n') | 94 | ('\n >>> testC not active: skipping tests for messages in C <<<\n') |
95 | else | 95 | else |
96 | print "testing memory error message" | 96 | print "testing memory error message" |
97 | local a = {} | 97 | local a = {} |
@@ -104,6 +104,19 @@ else | |||
104 | end) | 104 | end) |
105 | T.totalmem(0) | 105 | T.totalmem(0) |
106 | assert(not st and msg == "not enough" .. " memory") | 106 | assert(not st and msg == "not enough" .. " memory") |
107 | |||
108 | -- stack space for luaL_traceback (bug in 5.4.6) | ||
109 | local res = T.testC[[ | ||
110 | # push 16 elements on the stack | ||
111 | pushnum 1; pushnum 1; pushnum 1; pushnum 1; pushnum 1; | ||
112 | pushnum 1; pushnum 1; pushnum 1; pushnum 1; pushnum 1; | ||
113 | pushnum 1; pushnum 1; pushnum 1; pushnum 1; pushnum 1; | ||
114 | pushnum 1; | ||
115 | # traceback should work with 4 remaining slots | ||
116 | traceback xuxu 1; | ||
117 | return 1 | ||
118 | ]] | ||
119 | assert(string.find(res, "xuxu.-main chunk")) | ||
107 | end | 120 | end |
108 | 121 | ||
109 | 122 | ||