diff --git a/ChangeLog b/ChangeLog index d1407a27d..f16d30cb3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2013-08-29 Paulo Andrade + + * lib/jit_arm-cpu.c, lib/jit_arm.c: Correct wrong test and update + of the thumb offset information, when checking if needing to + patch a jump from arm to thumb mode. The problem would happen when + remapping the code buffer, and the new address being lower than + the previous one. + 2013-08-26 Paulo Andrade * configure.ac: Extend FreeBSD test to also handle NetBSD. diff --git a/lib/jit_arm-cpu.c b/lib/jit_arm-cpu.c index c324f00c0..71d178d98 100644 --- a/lib/jit_arm-cpu.c +++ b/lib/jit_arm-cpu.c @@ -3755,7 +3755,7 @@ _patch_at(jit_state_t *_jit, } u; u.w = instr; if (kind == arm_patch_jump) { - if (jit_thumb_p() && instr >= _jitc->thumb) { + if (jit_thumb_p() && (jit_uword_t)instr >= _jitc->thumb) { code2thumb(thumb.s[0], thumb.s[1], u.s[0], u.s[1]); if ((thumb.i & THUMB2_B) == THUMB2_B) { d = ((label - instr) >> 1) - 2; diff --git a/lib/jit_arm.c b/lib/jit_arm.c index 59c9d93ff..1cc444fa8 100644 --- a/lib/jit_arm.c +++ b/lib/jit_arm.c @@ -810,6 +810,7 @@ _emit_code(jit_state_t *_jit) } undo; _jitc->function = NULL; + _jitc->thumb = 0; jit_reglive_setup();