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) BCReg nret = expr_list(ls, &e); if (nret == 1) { /* Return one result. */ if (e.k == VCALL) { /* Check for tail call. */ +#ifdef LUAJIT_DISABLE_TAILCALL + goto notailcall; +#else BCIns *ip = bcptr(fs, &e); /* It doesn't pay off to add BC_VARGT just for 'return ...'. */ if (bc_op(*ip) == BC_VARG) goto notailcall; fs->pc--; ins = BCINS_AD(bc_op(*ip)-BC_CALL+BC_CALLT, bc_a(*ip), bc_c(*ip)); +#endif } else { /* Can return the result from any register. */ ins = BCINS_AD(BC_RET1, expr_toanyreg(fs, &e), 2); }