diff options
| author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2000-10-09 13:46:43 -0200 |
|---|---|---|
| committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2000-10-09 13:46:43 -0200 |
| commit | 46b543ebef302ddb70cee59bb47ca542828de1d2 (patch) | |
| tree | d18b1bd072a679d0805e5b75349a5a3596bc27b4 /ldo.c | |
| parent | 79909a92e194ccf4bf34e045993b88c89154f3ad (diff) | |
| download | lua-46b543ebef302ddb70cee59bb47ca542828de1d2.tar.gz lua-46b543ebef302ddb70cee59bb47ca542828de1d2.tar.bz2 lua-46b543ebef302ddb70cee59bb47ca542828de1d2.zip | |
better treatment for errors inside _ERRORMETHOD
Diffstat (limited to 'ldo.c')
| -rw-r--r-- | ldo.c | 7 |
1 files changed, 3 insertions, 4 deletions
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: ldo.c,v 1.104 2000/10/06 12:45:25 roberto Exp roberto $ | 2 | ** $Id: ldo.c,v 1.105 2000/10/09 13:47:32 roberto Exp roberto $ |
| 3 | ** Stack and Call structure of Lua | 3 | ** Stack and Call structure of Lua |
| 4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
| 5 | */ | 5 | */ |
| @@ -43,9 +43,8 @@ void luaD_init (lua_State *L, int stacksize) { | |||
| 43 | void luaD_checkstack (lua_State *L, int n) { | 43 | void luaD_checkstack (lua_State *L, int n) { |
| 44 | if (L->stack_last - L->top <= n) { /* stack overflow? */ | 44 | if (L->stack_last - L->top <= n) { /* stack overflow? */ |
| 45 | if (L->stack_last-L->stack > (L->stacksize-1)) { | 45 | if (L->stack_last-L->stack > (L->stacksize-1)) { |
| 46 | /* overflow while handling overflow: do what?? */ | 46 | /* overflow while handling overflow */ |
| 47 | L->top -= EXTRA_STACK; | 47 | luaD_breakrun(L, LUA_ERRERR); /* break run without error message */ |
| 48 | lua_error(L, "BAD STACK OVERFLOW! DATA CORRUPTED!"); | ||
| 49 | } | 48 | } |
| 50 | else { | 49 | else { |
| 51 | L->stack_last += EXTRA_STACK; /* to be used by error message */ | 50 | L->stack_last += EXTRA_STACK; /* to be used by error message */ |
