aboutsummaryrefslogtreecommitdiff
path: root/bugs
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2006-06-05 16:36:45 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2006-06-05 16:36:45 -0300
commita62fca1ebb0798676a11c5bda2406e36de654b6e (patch)
treec0825f2fbbb9a58b5ff204f976bbe36756d15fff /bugs
parent2b5c1f99e52fd725b3c3c58d80596dbb4a342da2 (diff)
downloadlua-a62fca1ebb0798676a11c5bda2406e36de654b6e.tar.gz
lua-a62fca1ebb0798676a11c5bda2406e36de654b6e.tar.bz2
lua-a62fca1ebb0798676a11c5bda2406e36de654b6e.zip
BUG: debug hooks may get wrong when mixed with coroutines
Diffstat (limited to 'bugs')
-rw-r--r--bugs39
1 files changed, 39 insertions, 0 deletions
diff --git a/bugs b/bugs
index 878117b1..a9f53823 100644
--- a/bugs
+++ b/bugs
@@ -974,3 +974,42 @@ lgc.c:
974+ g->estimate -= GCFINALIZECOST; 974+ g->estimate -= GCFINALIZECOST;
975]] 975]]
976} 976}
977
978
979But{
980
981what = [[debug hooks may get wrong when mixed with coroutines]],
982
983report = [[by Ivko Stanilov, 03/06/2006]],
984
985example = [[
986co = coroutine.create(function (a,b)
987 coroutine.yield(a, b)
988 return b, "end"
989end)
990
991debug.sethook(co, function() end, "lcr")
992coroutine.resume(co, 100, 2000)
993coroutine.resume(co, 100, 2000)
994]],
995
996patch = [[
997* ldo.c:
998@@ -389,6 +389,7 @@
999 return;
1000 }
1001 else { /* resuming from previous yield */
1002+ L->status = 0;
1003 if (!f_isLua(ci)) { /* `common' yield? */
1004 /* finish interrupted execution of `OP_CALL' */
1005 lua_assert(GET_OPCODE(*((ci-1)->savedpc - 1)) == OP_CALL ||
1006@@ -399,7 +400,6 @@
1007 else /* yielded inside a hook: just continue its execution */
1008 L->base = L->ci->base;
1009 }
1010- L->status = 0;
1011 luaV_execute(L, cast_int(L->ci - L->base_ci));
1012 }
1013]],
1014
1015}