diff options
Diffstat (limited to 'testes')
| -rw-r--r-- | testes/cstack.lua | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/testes/cstack.lua b/testes/cstack.lua index e3e14f74..4e37b988 100644 --- a/testes/cstack.lua +++ b/testes/cstack.lua | |||
| @@ -105,6 +105,22 @@ do print("testing stack-overflow in recursive 'gsub'") | |||
| 105 | print("\tfinal count: ", count) | 105 | print("\tfinal count: ", count) |
| 106 | end | 106 | end |
| 107 | 107 | ||
| 108 | do -- bug in 5.4.0 | ||
| 109 | print("testing limits in coroutines inside deep calls") | ||
| 110 | count = 0 | ||
| 111 | local lim = 1000 | ||
| 112 | local function stack (n) | ||
| 113 | progress() | ||
| 114 | if n > 0 then return stack(n - 1) + 1 | ||
| 115 | else coroutine.wrap(function () | ||
| 116 | stack(lim) | ||
| 117 | end)() | ||
| 118 | end | ||
| 119 | end | ||
| 120 | |||
| 121 | print(xpcall(stack, function () return "ok" end, lim)) | ||
| 122 | end | ||
| 123 | |||
| 108 | 124 | ||
| 109 | do print("testing changes in C-stack limit") | 125 | do print("testing changes in C-stack limit") |
| 110 | 126 | ||
