diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/lj_parse.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/lj_parse.c b/src/lj_parse.c index db3ce8e7..4fdd4c65 100644 --- a/src/lj_parse.c +++ b/src/lj_parse.c | |||
| @@ -2339,11 +2339,15 @@ static void parse_return(LexState *ls) | |||
| 2339 | BCReg nret = expr_list(ls, &e); | 2339 | BCReg nret = expr_list(ls, &e); |
| 2340 | if (nret == 1) { /* Return one result. */ | 2340 | if (nret == 1) { /* Return one result. */ |
| 2341 | if (e.k == VCALL) { /* Check for tail call. */ | 2341 | if (e.k == VCALL) { /* Check for tail call. */ |
| 2342 | #ifdef LUAJIT_DISABLE_TAILCALL | ||
| 2343 | goto notailcall; | ||
| 2344 | #else | ||
| 2342 | BCIns *ip = bcptr(fs, &e); | 2345 | BCIns *ip = bcptr(fs, &e); |
| 2343 | /* It doesn't pay off to add BC_VARGT just for 'return ...'. */ | 2346 | /* It doesn't pay off to add BC_VARGT just for 'return ...'. */ |
| 2344 | if (bc_op(*ip) == BC_VARG) goto notailcall; | 2347 | if (bc_op(*ip) == BC_VARG) goto notailcall; |
| 2345 | fs->pc--; | 2348 | fs->pc--; |
| 2346 | ins = BCINS_AD(bc_op(*ip)-BC_CALL+BC_CALLT, bc_a(*ip), bc_c(*ip)); | 2349 | ins = BCINS_AD(bc_op(*ip)-BC_CALL+BC_CALLT, bc_a(*ip), bc_c(*ip)); |
| 2350 | #endif | ||
| 2347 | } else { /* Can return the result from any register. */ | 2351 | } else { /* Can return the result from any register. */ |
| 2348 | ins = BCINS_AD(BC_RET1, expr_toanyreg(fs, &e), 2); | 2352 | ins = BCINS_AD(BC_RET1, expr_toanyreg(fs, &e), 2); |
| 2349 | } | 2353 | } |
