aboutsummaryrefslogtreecommitdiff
path: root/testes
diff options
context:
space:
mode:
Diffstat (limited to 'testes')
-rw-r--r--testes/coroutine.lua15
1 files changed, 6 insertions, 9 deletions
diff --git a/testes/coroutine.lua b/testes/coroutine.lua
index 76c9d6e6..15fccc30 100644
--- a/testes/coroutine.lua
+++ b/testes/coroutine.lua
@@ -741,20 +741,17 @@ _X()
741 741
742if not _soft then 742if not _soft then
743 -- bug (stack overflow) 743 -- bug (stack overflow)
744 local j = 2^9 744 local lim = 1000000 -- stack limit; assume 32-bit machine
745 local lim = 1000000 -- (C stack limit; assume 32-bit machine) 745 local t = {lim - 10, lim - 5, lim - 1, lim, lim + 1, lim + 5}
746 local t = {lim - 10, lim - 5, lim - 1, lim, lim + 1}
747 for i = 1, #t do 746 for i = 1, #t do
748 local j = t[i] 747 local j = t[i]
749 co = coroutine.create(function() 748 local co = coroutine.create(function()
750 local t = {} 749 return table.unpack({}, 1, j)
751 for i = 1, j do t[i] = i end
752 return table.unpack(t)
753 end) 750 end)
754 local r, msg = coroutine.resume(co) 751 local r, msg = coroutine.resume(co)
755 assert(not r) 752 -- must fail for unpacking larger than stack limit
753 assert(j < lim or not r)
756 end 754 end
757 co = nil
758end 755end
759 756
760 757