summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2012-05-11 11:10:28 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2012-05-11 11:10:28 -0300
commit4ec7d6de95bcf9fa35a9b268a41154b142190691 (patch)
tree595b8b1c98d84cc7ad0a4e15b14e16441c1e1c40
parentf6a12948ca597e6492660f81d121e8474cc8dd1d (diff)
downloadlua-4ec7d6de95bcf9fa35a9b268a41154b142190691.tar.gz
lua-4ec7d6de95bcf9fa35a9b268a41154b142190691.tar.bz2
lua-4ec7d6de95bcf9fa35a9b268a41154b142190691.zip
bug: wrong handling of 'nCcalls' in coroutines
-rw-r--r--bugs41
1 files changed, 35 insertions, 6 deletions
diff --git a/bugs b/bugs
index ff499e50..c114b963 100644
--- a/bugs
+++ b/bugs
@@ -1880,8 +1880,8 @@ patch = [[
1880+++ lundump.c 2008/04/04 19:51:41 2.7.1.4 1880+++ lundump.c 2008/04/04 19:51:41 2.7.1.4
1881@@ -1,5 +1,5 @@ 1881@@ -1,5 +1,5 @@
1882 /* 1882 /*
1883-** $Id: bugs,v 1.112 2012/01/20 18:32:13 roberto Exp roberto $ 1883-** $Id: bugs,v 1.113 2012/04/12 16:25:25 roberto Exp roberto $
1884+** $Id: bugs,v 1.112 2012/01/20 18:32:13 roberto Exp roberto $ 1884+** $Id: bugs,v 1.113 2012/04/12 16:25:25 roberto Exp roberto $
1885 ** load precompiled Lua chunks 1885 ** load precompiled Lua chunks
1886 ** See Copyright Notice in lua.h 1886 ** See Copyright Notice in lua.h
1887 */ 1887 */
@@ -2532,10 +2532,7 @@ foo = m.foo -- 'foo' may be any function from 'mod'
2532-- end program; it crashes 2532-- end program; it crashes
2533]], 2533]],
2534patch = [[ 2534patch = [[
2535=================================================================== 2535loadlib.c:
2536RCS file: RCS/loadlib.c,v
2537retrieving revision 1.108
2538diff -r1.108 loadlib.c
253995c95 253695c95
2540< #define LIBPREFIX "LOADLIB: " 2537< #define LIBPREFIX "LOADLIB: "
2541--- 2538---
@@ -2619,6 +2616,38 @@ diff -r1.108 loadlib.c
2619]] 2616]]
2620} 2617}
2621 2618
2619Bug{
2620what = [[wrong handling of 'nCcalls' in coroutines]],
2621report = [[Alexander Gavrilov, 2012/04/18]],
2622since = [[5.2.0]],
2623example = [[
2624coroutine.wrap(function()
2625 print(pcall(pcall,pcall,pcall,pcall,pcall,error,3))
2626end)()
2627]],
2628patch = [[
2629--- ldo.c 2011/11/29 15:55:08 2.102
2630+++ ldo.c 2012/04/26 20:38:32
2631@@ -402,8 +402,6 @@
2632 int n;
2633 lua_assert(ci->u.c.k != NULL); /* must have a continuation */
2634 lua_assert(L->nny == 0);
2635- /* finish 'luaD_call' */
2636- L->nCcalls--;
2637 /* finish 'lua_callk' */
2638 adjustresults(L, ci->nresults);
2639 /* call continuation function */
2640@@ -513,7 +511,6 @@
2641 api_checknelems(L, n);
2642 firstArg = L->top - n; /* yield results come from continuation */
2643 }
2644- L->nCcalls--; /* finish 'luaD_call' */
2645 luaD_poscall(L, firstArg); /* finish 'luaD_precall' */
2646 }
2647 unroll(L, NULL);
2648]]
2649}
2650
2622 2651
2623--[=[ 2652--[=[
2624Bug{ 2653Bug{