diff options
-rw-r--r-- | ltests.c | 10 |
1 files changed, 9 insertions, 1 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: ltests.c,v 2.129 2012/05/31 20:25:42 roberto Exp $ | 2 | ** $Id: ltests.c,v 2.130 2012/06/07 18:52:47 roberto Exp roberto $ |
3 | ** Internal Module for Debugging of the Lua Implementation | 3 | ** Internal Module for Debugging of the Lua Implementation |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -663,7 +663,15 @@ static int gc_state (lua_State *L) { | |||
663 | return 1; | 663 | return 1; |
664 | } | 664 | } |
665 | else { | 665 | else { |
666 | global_State *g = G(L); | ||
667 | if (g->gckind == KGC_GEN && option == GCSpause) | ||
668 | luaL_error(L, "cannot go to 'pause' state in generational mode"); | ||
666 | lua_lock(L); | 669 | lua_lock(L); |
670 | if (option < g->gcstate) { /* must cross 'pause'? */ | ||
671 | luaC_runtilstate(L, bitmask(GCSpause)); /* run until pause */ | ||
672 | if (g->gckind == KGC_GEN) | ||
673 | g->gcstate = GCSpropagate; /* skip pause in gen. mode */ | ||
674 | } | ||
667 | luaC_runtilstate(L, bitmask(option)); | 675 | luaC_runtilstate(L, bitmask(option)); |
668 | lua_assert(G(L)->gcstate == option); | 676 | lua_assert(G(L)->gcstate == option); |
669 | lua_unlock(L); | 677 | lua_unlock(L); |