diff options
-rw-r--r-- | ldo.c | 10 | ||||
-rw-r--r-- | ldo.h | 5 |
2 files changed, 6 insertions, 9 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: ldo.c,v 2.76 2009/12/10 18:20:07 roberto Exp roberto $ | 2 | ** $Id: ldo.c,v 2.77 2009/12/17 12:26:09 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 | */ |
@@ -81,7 +81,7 @@ struct lua_longjmp { | |||
81 | }; | 81 | }; |
82 | 82 | ||
83 | 83 | ||
84 | void luaD_seterrorobj (lua_State *L, int errcode, StkId oldtop) { | 84 | static void seterrorobj (lua_State *L, int errcode, StkId oldtop) { |
85 | switch (errcode) { | 85 | switch (errcode) { |
86 | case LUA_ERRMEM: { | 86 | case LUA_ERRMEM: { |
87 | setsvalue2s(L, oldtop, luaS_newliteral(L, MEMERRMSG)); | 87 | setsvalue2s(L, oldtop, luaS_newliteral(L, MEMERRMSG)); |
@@ -454,7 +454,7 @@ static int recover (lua_State *L, int status) { | |||
454 | /* "finish" luaD_pcall */ | 454 | /* "finish" luaD_pcall */ |
455 | oldtop = restorestack(L, ci->u.c.oldtop); | 455 | oldtop = restorestack(L, ci->u.c.oldtop); |
456 | luaF_close(L, oldtop); | 456 | luaF_close(L, oldtop); |
457 | luaD_seterrorobj(L, status, oldtop); | 457 | seterrorobj(L, status, oldtop); |
458 | L->ci = ci; | 458 | L->ci = ci; |
459 | L->allowhook = ci->u.c.old_allowhook; | 459 | L->allowhook = ci->u.c.old_allowhook; |
460 | L->nny = 0; /* should be zero to be yieldable */ | 460 | L->nny = 0; /* should be zero to be yieldable */ |
@@ -535,7 +535,7 @@ LUA_API int lua_resume (lua_State *L, int nargs) { | |||
535 | status = luaD_rawrunprotected(L, unroll, NULL); /* run continuation */ | 535 | status = luaD_rawrunprotected(L, unroll, NULL); /* run continuation */ |
536 | else { /* unrecoverable error */ | 536 | else { /* unrecoverable error */ |
537 | L->status = cast_byte(status); /* mark thread as `dead' */ | 537 | L->status = cast_byte(status); /* mark thread as `dead' */ |
538 | luaD_seterrorobj(L, status, L->top); | 538 | seterrorobj(L, status, L->top); |
539 | L->ci->top = L->top; | 539 | L->ci->top = L->top; |
540 | break; | 540 | break; |
541 | } | 541 | } |
@@ -586,7 +586,7 @@ int luaD_pcall (lua_State *L, Pfunc func, void *u, | |||
586 | if (status != LUA_OK) { /* an error occurred? */ | 586 | if (status != LUA_OK) { /* an error occurred? */ |
587 | StkId oldtop = restorestack(L, old_top); | 587 | StkId oldtop = restorestack(L, old_top); |
588 | luaF_close(L, oldtop); /* close possible pending closures */ | 588 | luaF_close(L, oldtop); /* close possible pending closures */ |
589 | luaD_seterrorobj(L, status, oldtop); | 589 | seterrorobj(L, status, oldtop); |
590 | L->ci = old_ci; | 590 | L->ci = old_ci; |
591 | L->allowhook = old_allowhooks; | 591 | L->allowhook = old_allowhooks; |
592 | L->nny = old_nny; | 592 | L->nny = old_nny; |
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: ldo.h,v 2.16 2009/11/19 16:24:41 roberto Exp roberto $ | 2 | ** $Id: ldo.h,v 2.17 2009/11/25 15:27:51 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 | */ |
@@ -41,8 +41,5 @@ LUAI_FUNC void luaD_shrinkstack (lua_State *L); | |||
41 | LUAI_FUNC void luaD_throw (lua_State *L, int errcode); | 41 | LUAI_FUNC void luaD_throw (lua_State *L, int errcode); |
42 | LUAI_FUNC int luaD_rawrunprotected (lua_State *L, Pfunc f, void *ud); | 42 | LUAI_FUNC int luaD_rawrunprotected (lua_State *L, Pfunc f, void *ud); |
43 | 43 | ||
44 | /* exported for Coco */ | ||
45 | LUAI_FUNC void luaD_seterrorobj (lua_State *L, int errcode, StkId oldtop); | ||
46 | |||
47 | #endif | 44 | #endif |
48 | 45 | ||