From b8e76d9b5c86182998c0616627607181154a60b1 Mon Sep 17 00:00:00 2001 From: Waldemar Celes Date: Tue, 27 Dec 1994 18:53:15 -0200 Subject: [PATCH] 'lua_getsubscript' and 'lua_storesubscript' now run unprotected (to improve efficiency) --- opcode.c | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/opcode.c b/opcode.c index 580ecc33..f1d021f7 100644 --- a/opcode.c +++ b/opcode.c @@ -3,7 +3,7 @@ ** TecCGraf - PUC-Rio */ -char *rcs_opcode="$Id: opcode.c,v 3.27 1994/12/16 16:08:34 roberto Exp roberto $"; +char *rcs_opcode="$Id: opcode.c,v 3.28 1994/12/20 21:20:36 roberto Exp celes $"; #include #include @@ -441,16 +441,10 @@ lua_Object lua_setfallback (char *name, lua_CFunction fallback) */ lua_Object lua_getsubscript (void) { - static Byte code[2] = {PUSHINDEXED, RETCODE0}; - int status; - Object func; - tag(&func) = LUA_T_FUNCTION; bvalue(&func) = code; adjustC(2); - status = do_protectedrun(&func, 1); - if (status == 0) - return (Ref(top-1)); - else - return LUA_NOOBJECT; + pushsubscript(); + CBase++; /* incorporate object in the stack */ + return (Ref(top-1)); } @@ -487,11 +481,9 @@ void lua_endblock (void) */ int lua_storesubscript (void) { - static Byte code[2] = {STOREINDEXED0, RETCODE0}; - Object func; - tag(&func) = LUA_T_FUNCTION; bvalue(&func) = code; adjustC(3); - return(do_protectedrun(&func, 0)); + storesubscript(); + return 0; } /*