diff options
Diffstat (limited to 'ldebug.c')
-rw-r--r-- | ldebug.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -844,7 +844,9 @@ l_noret luaG_runerror (lua_State *L, const char *fmt, ...) { | |||
844 | va_start(argp, fmt); | 844 | va_start(argp, fmt); |
845 | msg = luaO_pushvfstring(L, fmt, argp); /* format message */ | 845 | msg = luaO_pushvfstring(L, fmt, argp); /* format message */ |
846 | va_end(argp); | 846 | va_end(argp); |
847 | if (msg != NULL && isLua(ci)) { /* Lua function? (and no error) */ | 847 | if (msg == NULL) /* no memory to format message? */ |
848 | luaD_throw(L, LUA_ERRMEM); | ||
849 | else if (isLua(ci)) { /* Lua function? */ | ||
848 | /* add source:line information */ | 850 | /* add source:line information */ |
849 | luaG_addinfo(L, msg, ci_func(ci)->p->source, getcurrentline(ci)); | 851 | luaG_addinfo(L, msg, ci_func(ci)->p->source, getcurrentline(ci)); |
850 | setobjs2s(L, L->top.p - 2, L->top.p - 1); /* remove 'msg' */ | 852 | setobjs2s(L, L->top.p - 2, L->top.p - 1); /* remove 'msg' */ |