diff options
Diffstat (limited to 'src/lj_crecord.c')
-rw-r--r-- | src/lj_crecord.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/lj_crecord.c b/src/lj_crecord.c index e5413fb3..b4bfd0c2 100644 --- a/src/lj_crecord.c +++ b/src/lj_crecord.c | |||
@@ -13,6 +13,7 @@ | |||
13 | #include "lj_err.h" | 13 | #include "lj_err.h" |
14 | #include "lj_str.h" | 14 | #include "lj_str.h" |
15 | #include "lj_tab.h" | 15 | #include "lj_tab.h" |
16 | #include "lj_frame.h" | ||
16 | #include "lj_ctype.h" | 17 | #include "lj_ctype.h" |
17 | #include "lj_cparse.h" | 18 | #include "lj_cparse.h" |
18 | #include "lj_cconv.h" | 19 | #include "lj_cconv.h" |
@@ -835,6 +836,15 @@ void LJ_FASTCALL recff_cdata_arith(jit_State *J, RecordFFData *rd) | |||
835 | err_type: | 836 | err_type: |
836 | lj_trace_err(J, LJ_TRERR_BADTYPE); | 837 | lj_trace_err(J, LJ_TRERR_BADTYPE); |
837 | } | 838 | } |
839 | /* Fixup cdata comparisons, too. Avoids some cdata escapes. */ | ||
840 | if (J->postproc == LJ_POST_FIXGUARD && frame_iscont(J->L->base-1)) { | ||
841 | const BCIns *pc = frame_contpc(J->L->base-1) - 1; | ||
842 | if (bc_op(*pc) <= BC_ISNEP) { | ||
843 | setframe_pc(&J2G(J)->tmptv, pc); | ||
844 | J2G(J)->tmptv.u32.lo = ((tref_istrue(tr) ^ bc_op(*pc)) & 1); | ||
845 | J->postproc = LJ_POST_FIXCOMP; | ||
846 | } | ||
847 | } | ||
838 | J->base[0] = tr; | 848 | J->base[0] = tr; |
839 | } | 849 | } |
840 | } | 850 | } |