diff options
Diffstat (limited to 'bugs')
| -rw-r--r-- | bugs | 39 |
1 files changed, 39 insertions, 0 deletions
| @@ -974,3 +974,42 @@ lgc.c: | |||
| 974 | + g->estimate -= GCFINALIZECOST; | 974 | + g->estimate -= GCFINALIZECOST; |
| 975 | ]] | 975 | ]] |
| 976 | } | 976 | } |
| 977 | |||
| 978 | |||
| 979 | But{ | ||
| 980 | |||
| 981 | what = [[debug hooks may get wrong when mixed with coroutines]], | ||
| 982 | |||
| 983 | report = [[by Ivko Stanilov, 03/06/2006]], | ||
| 984 | |||
| 985 | example = [[ | ||
| 986 | co = coroutine.create(function (a,b) | ||
| 987 | coroutine.yield(a, b) | ||
| 988 | return b, "end" | ||
| 989 | end) | ||
| 990 | |||
| 991 | debug.sethook(co, function() end, "lcr") | ||
| 992 | coroutine.resume(co, 100, 2000) | ||
| 993 | coroutine.resume(co, 100, 2000) | ||
| 994 | ]], | ||
| 995 | |||
| 996 | patch = [[ | ||
| 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 | } | ||
