diff options
Diffstat (limited to 'ldebug.c')
-rw-r--r-- | ldebug.c | 9 |
1 files changed, 3 insertions, 6 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: ldebug.c,v 2.149 2017/12/15 13:07:10 roberto Exp roberto $ | 2 | ** $Id: ldebug.c,v 2.150 2017/12/20 14:58:05 roberto Exp roberto $ |
3 | ** Debug Interface | 3 | ** Debug Interface |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -737,8 +737,6 @@ l_noret luaG_runerror (lua_State *L, const char *fmt, ...) { | |||
737 | const char *msg; | 737 | const char *msg; |
738 | va_list argp; | 738 | va_list argp; |
739 | luaC_checkGC(L); /* error message uses memory */ | 739 | luaC_checkGC(L); /* error message uses memory */ |
740 | if (isLuacode(ci)) | ||
741 | L->top = ci->top; /* prepare top */ | ||
742 | va_start(argp, fmt); | 740 | va_start(argp, fmt); |
743 | msg = luaO_pushvfstring(L, fmt, argp); /* format message */ | 741 | msg = luaO_pushvfstring(L, fmt, argp); /* format message */ |
744 | va_end(argp); | 742 | va_end(argp); |
@@ -762,7 +760,6 @@ static int changedline (Proto *p, int oldpc, int newpc) { | |||
762 | 760 | ||
763 | 761 | ||
764 | void luaG_traceexec (lua_State *L) { | 762 | void luaG_traceexec (lua_State *L) { |
765 | ptrdiff_t oldtop = savestack(L, L->top); | ||
766 | CallInfo *ci = L->ci; | 763 | CallInfo *ci = L->ci; |
767 | lu_byte mask = L->hookmask; | 764 | lu_byte mask = L->hookmask; |
768 | int counthook = (--L->hookcount == 0 && (mask & LUA_MASKCOUNT)); | 765 | int counthook = (--L->hookcount == 0 && (mask & LUA_MASKCOUNT)); |
@@ -774,7 +771,8 @@ void luaG_traceexec (lua_State *L) { | |||
774 | ci->callstatus &= ~CIST_HOOKYIELD; /* erase mark */ | 771 | ci->callstatus &= ~CIST_HOOKYIELD; /* erase mark */ |
775 | return; /* do not call hook again (VM yielded, so it did not move) */ | 772 | return; /* do not call hook again (VM yielded, so it did not move) */ |
776 | } | 773 | } |
777 | L->top = ci->top; /* prepare top */ | 774 | if (!isIT(*(ci->u.l.savedpc - 1))) |
775 | L->top = ci->top; /* prepare top */ | ||
778 | if (counthook) | 776 | if (counthook) |
779 | luaD_hook(L, LUA_HOOKCOUNT, -1); /* call count hook */ | 777 | luaD_hook(L, LUA_HOOKCOUNT, -1); /* call count hook */ |
780 | if (mask & LUA_MASKLINE) { | 778 | if (mask & LUA_MASKLINE) { |
@@ -789,7 +787,6 @@ void luaG_traceexec (lua_State *L) { | |||
789 | } | 787 | } |
790 | L->oldpc = npc; | 788 | L->oldpc = npc; |
791 | } | 789 | } |
792 | L->top = restorestack(L, oldtop); | ||
793 | if (L->status == LUA_YIELD) { /* did hook yield? */ | 790 | if (L->status == LUA_YIELD) { /* did hook yield? */ |
794 | if (counthook) | 791 | if (counthook) |
795 | L->hookcount = 1; /* undo decrement to zero */ | 792 | L->hookcount = 1; /* undo decrement to zero */ |