aboutsummaryrefslogtreecommitdiff
path: root/ldo.c
diff options
context:
space:
mode:
Diffstat (limited to 'ldo.c')
-rw-r--r--ldo.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/ldo.c b/ldo.c
index 71e19e0f..384bd244 100644
--- a/ldo.c
+++ b/ldo.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: ldo.c,v 1.56 1999/12/02 16:41:29 roberto Exp roberto $ 2** $Id: ldo.c,v 1.57 1999/12/06 11:43:58 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*/
@@ -243,12 +243,13 @@ void lua_error (lua_State *L, const char *s) {
243 243
244 244
245/* 245/*
246** Execute a protected call. Assumes that function is at L->Cstack.base and 246** Execute a protected call. Assumes that function is at Cstack.base and
247** parameters are on top of it. Leave nResults on the stack. 247** parameters are on top of it.
248*/ 248*/
249int luaD_protectedrun (lua_State *L) { 249int luaD_protectedrun (lua_State *L) {
250 struct lua_longjmp myErrorJmp; 250 struct lua_longjmp myErrorJmp;
251 volatile StkId base = L->Cstack.base; 251 volatile StkId base = L->Cstack.base;
252 volatile int numCblocks = L->numCblocks;
252 volatile int status; 253 volatile int status;
253 struct lua_longjmp *volatile oldErr = L->errorJmp; 254 struct lua_longjmp *volatile oldErr = L->errorJmp;
254 L->errorJmp = &myErrorJmp; 255 L->errorJmp = &myErrorJmp;
@@ -262,6 +263,7 @@ int luaD_protectedrun (lua_State *L) {
262 else { /* an error occurred: restore the stack */ 263 else { /* an error occurred: restore the stack */
263 L->Cstack.num = 0; /* no results */ 264 L->Cstack.num = 0; /* no results */
264 L->top = L->Cstack.base = L->Cstack.lua2C = base; 265 L->top = L->Cstack.base = L->Cstack.lua2C = base;
266 L->numCblocks = numCblocks;
265 restore_stack_limit(L); 267 restore_stack_limit(L);
266 status = 1; 268 status = 1;
267 } 269 }
@@ -276,6 +278,7 @@ int luaD_protectedrun (lua_State *L) {
276static int protectedparser (lua_State *L, ZIO *z, int bin) { 278static int protectedparser (lua_State *L, ZIO *z, int bin) {
277 struct lua_longjmp myErrorJmp; 279 struct lua_longjmp myErrorJmp;
278 volatile StkId base = L->Cstack.base; 280 volatile StkId base = L->Cstack.base;
281 volatile int numCblocks = L->numCblocks;
279 volatile int status; 282 volatile int status;
280 TProtoFunc *volatile tf; 283 TProtoFunc *volatile tf;
281 struct lua_longjmp *volatile oldErr = L->errorJmp; 284 struct lua_longjmp *volatile oldErr = L->errorJmp;
@@ -288,6 +291,7 @@ static int protectedparser (lua_State *L, ZIO *z, int bin) {
288 else { /* an error occurred: restore Cstack and top */ 291 else { /* an error occurred: restore Cstack and top */
289 L->Cstack.num = 0; /* no results */ 292 L->Cstack.num = 0; /* no results */
290 L->top = L->Cstack.base = L->Cstack.lua2C = base; 293 L->top = L->Cstack.base = L->Cstack.lua2C = base;
294 L->numCblocks = numCblocks;
291 tf = NULL; 295 tf = NULL;
292 status = 1; 296 status = 1;
293 } 297 }