diff options
Diffstat (limited to 'lvm.c')
-rw-r--r-- | lvm.c | 21 |
1 files changed, 6 insertions, 15 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lvm.c,v 1.72 1999/12/09 20:01:48 roberto Exp roberto $ | 2 | ** $Id: lvm.c,v 1.73 1999/12/14 18:31:20 roberto Exp roberto $ |
3 | ** Lua virtual machine | 3 | ** Lua virtual machine |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -294,8 +294,6 @@ StkId luaV_execute (lua_State *L, const Closure *cl, const TProtoFunc *tf, | |||
294 | register StkId top; /* keep top local, for performance */ | 294 | register StkId top; /* keep top local, for performance */ |
295 | register const Byte *pc = tf->code; | 295 | register const Byte *pc = tf->code; |
296 | const TObject *consts = tf->consts; | 296 | const TObject *consts = tf->consts; |
297 | if (L->callhook) | ||
298 | luaD_callHook(L, base, tf, 0); | ||
299 | luaD_checkstack(L, (*pc++)+EXTRA_STACK); | 297 | luaD_checkstack(L, (*pc++)+EXTRA_STACK); |
300 | if (*pc < ZEROVARARG) | 298 | if (*pc < ZEROVARARG) |
301 | luaD_adjusttop(L, base, *(pc++)); | 299 | luaD_adjusttop(L, base, *(pc++)); |
@@ -310,12 +308,11 @@ StkId luaV_execute (lua_State *L, const Closure *cl, const TProtoFunc *tf, | |||
310 | switch ((OpCode)*pc++) { | 308 | switch ((OpCode)*pc++) { |
311 | 309 | ||
312 | case ENDCODE: | 310 | case ENDCODE: |
313 | top = base; | 311 | return L->top; /* no results */ |
314 | goto ret; | ||
315 | 312 | ||
316 | case RETCODE: | 313 | case RETCODE: |
317 | base += *pc++; | 314 | L->top = top; |
318 | goto ret; | 315 | return base+(*pc++); |
319 | 316 | ||
320 | case CALL: aux = *pc++; | 317 | case CALL: aux = *pc++; |
321 | L->top = top; | 318 | L->top = top; |
@@ -326,9 +323,7 @@ StkId luaV_execute (lua_State *L, const Closure *cl, const TProtoFunc *tf, | |||
326 | case TAILCALL: aux = *pc++; | 323 | case TAILCALL: aux = *pc++; |
327 | L->top = top; | 324 | L->top = top; |
328 | luaD_call(L, base+(*pc++), MULT_RET); | 325 | luaD_call(L, base+(*pc++), MULT_RET); |
329 | top = L->top; | 326 | return base+aux; |
330 | base += aux; | ||
331 | goto ret; | ||
332 | 327 | ||
333 | case PUSHNIL: aux = *pc++; | 328 | case PUSHNIL: aux = *pc++; |
334 | do { | 329 | do { |
@@ -608,9 +603,5 @@ StkId luaV_execute (lua_State *L, const Closure *cl, const TProtoFunc *tf, | |||
608 | goto switchentry; /* do not reset "aux" */ | 603 | goto switchentry; /* do not reset "aux" */ |
609 | 604 | ||
610 | } | 605 | } |
611 | } ret: | 606 | } |
612 | L->top = top; | ||
613 | if (L->callhook) | ||
614 | luaD_callHook(L, 0, NULL, 1); | ||
615 | return base; | ||
616 | } | 607 | } |