diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2014-12-10 09:30:09 -0200 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2014-12-10 09:30:09 -0200 |
commit | b4633c586b4ca189d3249e8c2b2a695a5280081c (patch) | |
tree | ce0c3008336e9918a1aa46102a0671d4741faed6 /ldebug.c | |
parent | 5fae2a5b05735e2853056ab8c415458a4e31917b (diff) | |
download | lua-b4633c586b4ca189d3249e8c2b2a695a5280081c.tar.gz lua-b4633c586b4ca189d3249e8c2b2a695a5280081c.tar.bz2 lua-b4633c586b4ca189d3249e8c2b2a695a5280081c.zip |
error handler does not need to be a function (can be a callable
object)
Diffstat (limited to 'ldebug.c')
-rw-r--r-- | ldebug.c | 3 |
1 files changed, 1 insertions, 2 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: ldebug.c,v 2.107 2014/11/11 17:08:19 roberto Exp roberto $ | 2 | ** $Id: ldebug.c,v 2.108 2014/12/08 15:48:23 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 | */ |
@@ -590,7 +590,6 @@ static void addinfo (lua_State *L, const char *msg) { | |||
590 | l_noret luaG_errormsg (lua_State *L) { | 590 | l_noret luaG_errormsg (lua_State *L) { |
591 | if (L->errfunc != 0) { /* is there an error handling function? */ | 591 | if (L->errfunc != 0) { /* is there an error handling function? */ |
592 | StkId errfunc = restorestack(L, L->errfunc); | 592 | StkId errfunc = restorestack(L, L->errfunc); |
593 | if (!ttisfunction(errfunc)) luaD_throw(L, LUA_ERRERR); | ||
594 | setobjs2s(L, L->top, L->top - 1); /* move argument */ | 593 | setobjs2s(L, L->top, L->top - 1); /* move argument */ |
595 | setobjs2s(L, L->top - 1, errfunc); /* push function */ | 594 | setobjs2s(L, L->top - 1, errfunc); /* push function */ |
596 | L->top++; /* assume EXTRA_STACK */ | 595 | L->top++; /* assume EXTRA_STACK */ |