diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2018-12-27 14:32:29 -0200 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2018-12-27 14:32:29 -0200 |
commit | ba7da13ec5938f978c37d63aa40a3e340b301f79 (patch) | |
tree | c1f22403954f6e0c6d17c8495c11509103313c9a /testes/pm.lua | |
parent | da37ac9c7894186a0e2e0e6f1f5f00b825fd1555 (diff) | |
download | lua-ba7da13ec5938f978c37d63aa40a3e340b301f79.tar.gz lua-ba7da13ec5938f978c37d63aa40a3e340b301f79.tar.bz2 lua-ba7da13ec5938f978c37d63aa40a3e340b301f79.zip |
Changes in the control of C-stack overflow
* unification of the 'nny' and 'nCcalls' counters;
* external C functions ('lua_CFunction') count more "slots" in
the C stack (to allow for their possible use of buffers)
* added a new test script specific for C-stack overflows. (Most
of those tests were already present, but concentrating them
in a single script easies the task of checking whether
'LUAI_MAXCCALLS' is adequate in a system.)
Diffstat (limited to 'testes/pm.lua')
-rw-r--r-- | testes/pm.lua | 12 |
1 files changed, 0 insertions, 12 deletions
diff --git a/testes/pm.lua b/testes/pm.lua index cdcf3bec..1afaccf6 100644 --- a/testes/pm.lua +++ b/testes/pm.lua | |||
@@ -237,18 +237,6 @@ checkerror("invalid capture index %%0", string.gsub, "alo", "(%0)", "a") | |||
237 | checkerror("invalid capture index %%1", string.gsub, "alo", "(%1)", "a") | 237 | checkerror("invalid capture index %%1", string.gsub, "alo", "(%1)", "a") |
238 | checkerror("invalid use of '%%'", string.gsub, "alo", ".", "%x") | 238 | checkerror("invalid use of '%%'", string.gsub, "alo", ".", "%x") |
239 | 239 | ||
240 | -- bug since 2.5 (C-stack overflow) | ||
241 | do | ||
242 | local function f (size) | ||
243 | local s = string.rep("a", size) | ||
244 | local p = string.rep(".?", size) | ||
245 | return pcall(string.match, s, p) | ||
246 | end | ||
247 | local r, m = f(80) | ||
248 | assert(r and #m == 80) | ||
249 | r, m = f(200000) | ||
250 | assert(not r and string.find(m, "too complex")) | ||
251 | end | ||
252 | 240 | ||
253 | if not _soft then | 241 | if not _soft then |
254 | print("big strings") | 242 | print("big strings") |