aboutsummaryrefslogtreecommitdiff
path: root/ldebug.c
diff options
context:
space:
mode:
Diffstat (limited to 'ldebug.c')
-rw-r--r--ldebug.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/ldebug.c b/ldebug.c
index 12b85bd1..2b7f566f 100644
--- a/ldebug.c
+++ b/ldebug.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: ldebug.c,v 1.120 2002/06/18 15:19:27 roberto Exp roberto $ 2** $Id: ldebug.c,v 1.121 2002/06/18 17:10:43 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*/
@@ -517,8 +517,9 @@ void luaG_ordererror (lua_State *L, const TObject *p1, const TObject *p2) {
517 517
518 518
519static void addinfo (lua_State *L, int internal) { 519static void addinfo (lua_State *L, int internal) {
520 CallInfo *ci = (internal) ? L->ci : L->ci - 1;
521 const char *msg = svalue(L->top - 1); 520 const char *msg = svalue(L->top - 1);
521 CallInfo *ci = L->ci;
522 if (!internal && ci > L->base_ci) ci--;
522 if (strchr(msg, '\n')) return; /* message already `formatted' */ 523 if (strchr(msg, '\n')) return; /* message already `formatted' */
523 if (!isLmark(ci)) { /* no Lua code? */ 524 if (!isLmark(ci)) { /* no Lua code? */
524 luaO_pushfstring(L, "%s\n", msg); /* no extra info */ 525 luaO_pushfstring(L, "%s\n", msg); /* no extra info */
@@ -543,6 +544,9 @@ void luaG_errormsg (lua_State *L, int internal) {
543 L->top += 2; 544 L->top += 2;
544 luaD_call(L, L->top - 2, 1); /* call error function? */ 545 luaD_call(L, L->top - 2, 1); /* call error function? */
545 } 546 }
547 else {
548 setnilvalue(L->top++);
549 }
546 luaD_throw(L, LUA_ERRRUN); 550 luaD_throw(L, LUA_ERRRUN);
547} 551}
548 552