diff options
| -rw-r--r-- | opcode.c | 20 |
1 files changed, 6 insertions, 14 deletions
| @@ -3,7 +3,7 @@ | |||
| 3 | ** TecCGraf - PUC-Rio | 3 | ** TecCGraf - PUC-Rio |
| 4 | */ | 4 | */ |
| 5 | 5 | ||
| 6 | char *rcs_opcode="$Id: opcode.c,v 3.27 1994/12/16 16:08:34 roberto Exp roberto $"; | 6 | char *rcs_opcode="$Id: opcode.c,v 3.28 1994/12/20 21:20:36 roberto Exp celes $"; |
| 7 | 7 | ||
| 8 | #include <setjmp.h> | 8 | #include <setjmp.h> |
| 9 | #include <stdio.h> | 9 | #include <stdio.h> |
| @@ -441,16 +441,10 @@ lua_Object lua_setfallback (char *name, lua_CFunction fallback) | |||
| 441 | */ | 441 | */ |
| 442 | lua_Object lua_getsubscript (void) | 442 | lua_Object lua_getsubscript (void) |
| 443 | { | 443 | { |
| 444 | static Byte code[2] = {PUSHINDEXED, RETCODE0}; | ||
| 445 | int status; | ||
| 446 | Object func; | ||
| 447 | tag(&func) = LUA_T_FUNCTION; bvalue(&func) = code; | ||
| 448 | adjustC(2); | 444 | adjustC(2); |
| 449 | status = do_protectedrun(&func, 1); | 445 | pushsubscript(); |
| 450 | if (status == 0) | 446 | CBase++; /* incorporate object in the stack */ |
| 451 | return (Ref(top-1)); | 447 | return (Ref(top-1)); |
| 452 | else | ||
| 453 | return LUA_NOOBJECT; | ||
| 454 | } | 448 | } |
| 455 | 449 | ||
| 456 | 450 | ||
| @@ -487,11 +481,9 @@ void lua_endblock (void) | |||
| 487 | */ | 481 | */ |
| 488 | int lua_storesubscript (void) | 482 | int lua_storesubscript (void) |
| 489 | { | 483 | { |
| 490 | static Byte code[2] = {STOREINDEXED0, RETCODE0}; | ||
| 491 | Object func; | ||
| 492 | tag(&func) = LUA_T_FUNCTION; bvalue(&func) = code; | ||
| 493 | adjustC(3); | 484 | adjustC(3); |
| 494 | return(do_protectedrun(&func, 0)); | 485 | storesubscript(); |
| 486 | return 0; | ||
| 495 | } | 487 | } |
| 496 | 488 | ||
| 497 | /* | 489 | /* |
