diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2001-04-23 13:35:45 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2001-04-23 13:35:45 -0300 |
commit | 572a69b6afbd368beab8844bc876b0f9690b5253 (patch) | |
tree | f2785c52e1ee9bab5b68823b9481af2510a90829 /lcode.c | |
parent | beee01b170c5fea9ed4527b28b9221d2df1baaba (diff) | |
download | lua-572a69b6afbd368beab8844bc876b0f9690b5253.tar.gz lua-572a69b6afbd368beab8844bc876b0f9690b5253.tar.bz2 lua-572a69b6afbd368beab8844bc876b0f9690b5253.zip |
name changes
Diffstat (limited to 'lcode.c')
-rw-r--r-- | lcode.c | 18 |
1 files changed, 7 insertions, 11 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lcode.c,v 1.66 2001/03/26 14:31:49 roberto Exp roberto $ | 2 | ** $Id: lcode.c,v 1.67 2001/04/06 18:25:00 roberto Exp roberto $ |
3 | ** Code generator for Lua | 3 | ** Code generator for Lua |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -265,14 +265,10 @@ void luaK_concat (FuncState *fs, int *l1, int l2) { | |||
265 | *l1 = l2; | 265 | *l1 = l2; |
266 | else { | 266 | else { |
267 | int list = *l1; | 267 | int list = *l1; |
268 | for (;;) { /* traverse `l1' */ | 268 | int next; |
269 | int next = luaK_getjump(fs, list); | 269 | while ((next = luaK_getjump(fs, list)) != NO_JUMP) /* find last element */ |
270 | if (next == NO_JUMP) { /* end of list? */ | ||
271 | luaK_fixjump(fs, list, l2); | ||
272 | return; | ||
273 | } | ||
274 | list = next; | 270 | list = next; |
275 | } | 271 | luaK_fixjump(fs, list, l2); |
276 | } | 272 | } |
277 | } | 273 | } |
278 | 274 | ||
@@ -310,8 +306,8 @@ void luaK_goiftrue (FuncState *fs, expdesc *v, int keepvalue) { | |||
310 | } | 306 | } |
311 | 307 | ||
312 | 308 | ||
313 | static void luaK_goiffalse (FuncState *fs, expdesc *v, int keepvalue) { | 309 | static void luaK_goiffalse (FuncState *fs, expdesc *v) { |
314 | luaK_testgo(fs, v, 0, keepvalue ? OP_JMPONT : OP_JMPT); | 310 | luaK_testgo(fs, v, 0, OP_JMPONT); |
315 | } | 311 | } |
316 | 312 | ||
317 | 313 | ||
@@ -385,7 +381,7 @@ void luaK_infix (LexState *ls, BinOpr op, expdesc *v) { | |||
385 | luaK_goiftrue(fs, v, 1); | 381 | luaK_goiftrue(fs, v, 1); |
386 | break; | 382 | break; |
387 | case OPR_OR: | 383 | case OPR_OR: |
388 | luaK_goiffalse(fs, v, 1); | 384 | luaK_goiffalse(fs, v); |
389 | break; | 385 | break; |
390 | default: | 386 | default: |
391 | luaK_tostack(ls, v, 1); /* all other binary operators need a value */ | 387 | luaK_tostack(ls, v, 1); /* all other binary operators need a value */ |