diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2012-05-11 11:10:28 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2012-05-11 11:10:28 -0300 |
commit | 4ec7d6de95bcf9fa35a9b268a41154b142190691 (patch) | |
tree | 595b8b1c98d84cc7ad0a4e15b14e16441c1e1c40 | |
parent | f6a12948ca597e6492660f81d121e8474cc8dd1d (diff) | |
download | lua-4ec7d6de95bcf9fa35a9b268a41154b142190691.tar.gz lua-4ec7d6de95bcf9fa35a9b268a41154b142190691.tar.bz2 lua-4ec7d6de95bcf9fa35a9b268a41154b142190691.zip |
bug: wrong handling of 'nCcalls' in coroutines
-rw-r--r-- | bugs | 41 |
1 files changed, 35 insertions, 6 deletions
@@ -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 | ]], |
2534 | patch = [[ | 2534 | patch = [[ |
2535 | =================================================================== | 2535 | loadlib.c: |
2536 | RCS file: RCS/loadlib.c,v | ||
2537 | retrieving revision 1.108 | ||
2538 | diff -r1.108 loadlib.c | ||
2539 | 95c95 | 2536 | 95c95 |
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 | ||
2619 | Bug{ | ||
2620 | what = [[wrong handling of 'nCcalls' in coroutines]], | ||
2621 | report = [[Alexander Gavrilov, 2012/04/18]], | ||
2622 | since = [[5.2.0]], | ||
2623 | example = [[ | ||
2624 | coroutine.wrap(function() | ||
2625 | print(pcall(pcall,pcall,pcall,pcall,pcall,error,3)) | ||
2626 | end)() | ||
2627 | ]], | ||
2628 | patch = [[ | ||
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 | --[=[ |
2624 | Bug{ | 2653 | Bug{ |