Skip to content

Commit 94d4abc

Browse files
author
Mike Pall
committed
Merge branch 'master' into v2.1
2 parents 46a6d06 + e296f56 commit 94d4abc

12 files changed

+15
-23
lines changed

src/lj_debug.c

+1
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ static BCPos debug_framepc(lua_State *L, GCfunc *fn, cTValue *nextframe)
9494
}
9595
}
9696
ins = cframe_pc(cf);
97+
if (!ins) return NO_BCPOS;
9798
}
9899
}
99100
pt = funcproto(fn);

src/lj_dispatch.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ extern double __divdf3(double a, double b);
4646
_(asin) _(acos) _(atan) _(sinh) _(cosh) _(tanh) _(frexp) _(modf) _(atan2) \
4747
_(pow) _(fmod) _(ldexp) _(lj_vm_modi) \
4848
_(lj_dispatch_call) _(lj_dispatch_ins) _(lj_dispatch_stitch) \
49-
_(lj_dispatch_profile) _(lj_err_throw) \
49+
_(lj_dispatch_profile) _(lj_err_throw) _(lj_err_run) \
5050
_(lj_ffh_coroutine_wrap_err) _(lj_func_closeuv) _(lj_func_newL_gc) \
5151
_(lj_gc_barrieruv) _(lj_gc_step) _(lj_gc_step_fixtop) _(lj_meta_arith) \
5252
_(lj_meta_call) _(lj_meta_cat) _(lj_meta_comp) _(lj_meta_equal) \

src/lj_err.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -598,7 +598,7 @@ static ptrdiff_t finderrfunc(lua_State *L)
598598
}
599599

600600
/* Runtime error. */
601-
LJ_NOINLINE void lj_err_run(lua_State *L)
601+
LJ_NOINLINE void LJ_FASTCALL lj_err_run(lua_State *L)
602602
{
603603
ptrdiff_t ef = finderrfunc(L);
604604
if (ef) {

src/lj_err.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ LJ_DATA const char *lj_err_allmsg;
2323
LJ_FUNC GCstr *lj_err_str(lua_State *L, ErrMsg em);
2424
LJ_FUNCA_NORET void LJ_FASTCALL lj_err_throw(lua_State *L, int errcode);
2525
LJ_FUNC_NORET void lj_err_mem(lua_State *L);
26-
LJ_FUNC_NORET void lj_err_run(lua_State *L);
26+
LJ_FUNCA_NORET void LJ_FASTCALL lj_err_run(lua_State *L);
2727
LJ_FUNC_NORET void lj_err_msg(lua_State *L, ErrMsg em);
2828
LJ_FUNC_NORET void lj_err_lex(lua_State *L, GCstr *src, const char *tok,
2929
BCLine line, ErrMsg em, va_list argp);

src/lj_trace.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -789,8 +789,8 @@ typedef struct ExitDataCP {
789789
static TValue *trace_exit_cp(lua_State *L, lua_CFunction dummy, void *ud)
790790
{
791791
ExitDataCP *exd = (ExitDataCP *)ud;
792-
cframe_errfunc(L->cframe) = -1; /* Inherit error function. */
793-
/* Always catch error here. */
792+
/* Always catch error here and don't call error function. */
793+
cframe_errfunc(L->cframe) = 0;
794794
cframe_nres(L->cframe) = -2*LUAI_MAXSTACK*(int)sizeof(TValue);
795795
exd->pc = lj_snap_restore(exd->J, exd->exptr);
796796
UNUSED(dummy);

src/vm_arm.dasc

+1-2
Original file line numberDiff line numberDiff line change
@@ -2245,9 +2245,8 @@ static void build_subroutines(BuildCtx *ctx)
22452245
| b <2
22462246
|
22472247
|9: // Rethrow error from the right C frame.
2248-
| rsb CARG2, CARG1, #0
22492248
| mov CARG1, L
2250-
| bl extern lj_err_throw // (lua_State *L, int errcode)
2249+
| bl extern lj_err_run // (lua_State *L)
22512250
|.endif
22522251
|
22532252
|//-----------------------------------------------------------------------

src/vm_arm64.dasc

+1-2
Original file line numberDiff line numberDiff line change
@@ -2035,9 +2035,8 @@ static void build_subroutines(BuildCtx *ctx)
20352035
| b <2
20362036
|
20372037
|9: // Rethrow error from the right C frame.
2038-
| neg CARG2, CARG1
20392038
| mov CARG1, L
2040-
| bl extern lj_err_throw // (lua_State *L, int errcode)
2039+
| bl extern lj_err_run // (lua_State *L)
20412040
|.endif
20422041
|
20432042
|//-----------------------------------------------------------------------

src/vm_mips.dasc

+2-3
Original file line numberDiff line numberDiff line change
@@ -2520,9 +2520,8 @@ static void build_subroutines(BuildCtx *ctx)
25202520
|. addu RA, RA, BASE
25212521
|
25222522
|9: // Rethrow error from the right C frame.
2523-
| load_got lj_err_throw
2524-
| negu CARG2, CRET1
2525-
| call_intern lj_err_throw // (lua_State *L, int errcode)
2523+
| load_got lj_err_run
2524+
| call_intern lj_err_run // (lua_State *L)
25262525
|. move CARG1, L
25272526
|.endif
25282527
|

src/vm_mips64.dasc

+2-3
Original file line numberDiff line numberDiff line change
@@ -2622,9 +2622,8 @@ static void build_subroutines(BuildCtx *ctx)
26222622
|. daddu RA, RA, BASE
26232623
|
26242624
|9: // Rethrow error from the right C frame.
2625-
| load_got lj_err_throw
2626-
| negu CARG2, CRET1
2627-
| call_intern lj_err_throw // (lua_State *L, int errcode)
2625+
| load_got lj_err_run
2626+
| call_intern lj_err_run // (lua_State *L)
26282627
|. move CARG1, L
26292628
|.endif
26302629
|

src/vm_ppc.dasc

+1-2
Original file line numberDiff line numberDiff line change
@@ -3090,9 +3090,8 @@ static void build_subroutines(BuildCtx *ctx)
30903090
| bctr
30913091
|
30923092
|9: // Rethrow error from the right C frame.
3093-
| neg CARG2, CARG1
30943093
| mr CARG1, L
3095-
| bl extern lj_err_throw // (lua_State *L, int errcode)
3094+
| bl extern lj_err_run // (lua_State *L)
30963095
|.endif
30973096
|
30983097
|//-----------------------------------------------------------------------

src/vm_x64.dasc

+1-3
Original file line numberDiff line numberDiff line change
@@ -2509,10 +2509,8 @@ static void build_subroutines(BuildCtx *ctx)
25092509
| jmp <2
25102510
|
25112511
|9: // Rethrow error from the right C frame.
2512-
| neg RD
25132512
| mov CARG1, L:RB
2514-
| mov CARG2, RD
2515-
| call extern lj_err_throw // (lua_State *L, int errcode)
2513+
| call extern lj_err_run // (lua_State *L)
25162514
|.endif
25172515
|
25182516
|//-----------------------------------------------------------------------

src/vm_x86.dasc

+1-3
Original file line numberDiff line numberDiff line change
@@ -2960,10 +2960,8 @@ static void build_subroutines(BuildCtx *ctx)
29602960
| jmp <2
29612961
|
29622962
|9: // Rethrow error from the right C frame.
2963-
| neg RD
29642963
| mov FCARG1, L:RB
2965-
| mov FCARG2, RD
2966-
| call extern lj_err_throw@8 // (lua_State *L, int errcode)
2964+
| call extern lj_err_run@4 // (lua_State *L)
29672965
|.endif
29682966
|
29692967
|//-----------------------------------------------------------------------

0 commit comments

Comments
 (0)