diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2002-05-13 10:09:00 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2002-05-13 10:09:00 -0300 |
commit | af19d556355b6e79296811cb18fe511f8784b8f1 (patch) | |
tree | 2126e8dec5d21939bb2ff298f29f0d429c62d7db /lvm.c | |
parent | b55fded18c270412e127259a5f28c785620dbf1a (diff) | |
download | lua-af19d556355b6e79296811cb18fe511f8784b8f1.tar.gz lua-af19d556355b6e79296811cb18fe511f8784b8f1.tar.bz2 lua-af19d556355b6e79296811cb18fe511f8784b8f1.zip |
generic for also coded to make test at the end of the loop
Diffstat (limited to 'lvm.c')
-rw-r--r-- | lvm.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lvm.c,v 1.229 2002/05/06 15:51:41 roberto Exp roberto $ | 2 | ** $Id: lvm.c,v 1.230 2002/05/09 14:14:34 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 | */ |
@@ -548,7 +548,8 @@ StkId luaV_execute (lua_State *L) { | |||
548 | L->top = ra+5; | 548 | L->top = ra+5; |
549 | luaD_call(L, ra+2, GETARG_C(i) + 1); | 549 | luaD_call(L, ra+2, GETARG_C(i) + 1); |
550 | L->top = L->ci->top; | 550 | L->top = L->ci->top; |
551 | if (ttype(ra+2) != LUA_TNIL) pc++; /* skip jump (keep looping) */ | 551 | if (ttype(ra+2) == LUA_TNIL) pc++; /* skip jump (break loop) */ |
552 | else dojump(pc, GETARG_sBx(*pc) + 1); /* else jump back */ | ||
552 | break; | 553 | break; |
553 | } | 554 | } |
554 | case OP_TFORPREP: { | 555 | case OP_TFORPREP: { |
@@ -557,6 +558,7 @@ StkId luaV_execute (lua_State *L) { | |||
557 | setsvalue(ra, luaS_new(L, "next")); | 558 | setsvalue(ra, luaS_new(L, "next")); |
558 | luaV_gettable(L, gt(L), ra, ra); | 559 | luaV_gettable(L, gt(L), ra, ra); |
559 | } | 560 | } |
561 | dojump(pc, GETARG_sBx(i)); | ||
560 | break; | 562 | break; |
561 | } | 563 | } |
562 | case OP_SETLIST: | 564 | case OP_SETLIST: |