summaryrefslogtreecommitdiff
path: root/src/lj_trace.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lj_trace.c')
-rw-r--r--src/lj_trace.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/lj_trace.c b/src/lj_trace.c
index b67e8f75..69124542 100644
--- a/src/lj_trace.c
+++ b/src/lj_trace.c
@@ -495,8 +495,8 @@ static int trace_abort(jit_State *J)
495 495
496 J->postproc = LJ_POST_NONE; 496 J->postproc = LJ_POST_NONE;
497 lj_mcode_abort(J); 497 lj_mcode_abort(J);
498 if (tvisnum(L->top-1)) 498 if (tvisnumber(L->top-1))
499 e = (TraceError)lj_num2int(numV(L->top-1)); 499 e = (TraceError)numberVint(L->top-1);
500 if (e == LJ_TRERR_MCODELM) { 500 if (e == LJ_TRERR_MCODELM) {
501 J->state = LJ_TRACE_ASM; 501 J->state = LJ_TRACE_ASM;
502 return 1; /* Retry ASM with new MCode area. */ 502 return 1; /* Retry ASM with new MCode area. */
@@ -703,8 +703,12 @@ int LJ_FASTCALL lj_trace_exit(jit_State *J, void *exptr)
703 setintV(L->top++, J->exitno); 703 setintV(L->top++, J->exitno);
704 setintV(L->top++, RID_NUM_GPR); 704 setintV(L->top++, RID_NUM_GPR);
705 setintV(L->top++, RID_NUM_FPR); 705 setintV(L->top++, RID_NUM_FPR);
706 for (i = 0; i < RID_NUM_GPR; i++) 706 for (i = 0; i < RID_NUM_GPR; i++) {
707 setnumV(L->top++, cast_num(ex->gpr[i])); 707 if (sizeof(ex->gpr[i]) == sizeof(int32_t))
708 setintV(L->top++, (int32_t)ex->gpr[i]);
709 else
710 setnumV(L->top++, (lua_Number)ex->gpr[i]);
711 }
708 for (i = 0; i < RID_NUM_FPR; i++) { 712 for (i = 0; i < RID_NUM_FPR; i++) {
709 setnumV(L->top, ex->fpr[i]); 713 setnumV(L->top, ex->fpr[i]);
710 if (LJ_UNLIKELY(tvisnan(L->top))) 714 if (LJ_UNLIKELY(tvisnan(L->top)))