diff --git a/ChangeLog b/ChangeLog index a174e6433..fe265f9b4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2013-04-08 Paulo Andrade + + * lib/jit_arm.c, lib/jit_ppc.c: Do not rely on __clear_cache + aligning to the next page boundary the end argument. It may + actually truncate it. + 2013-03-29 Paulo Andrade * include/lightning/jit_private.h, lib/jit_arm.c, lib/jit_memory.c, diff --git a/lib/jit_arm.c b/lib/jit_arm.c index c4fe59e27..07223e558 100644 --- a/lib/jit_arm.c +++ b/lib/jit_arm.c @@ -1563,7 +1563,8 @@ _emit_code(jit_state_t *_jit) patch_at(_jitc->patches.ptr[offset].kind & ~arm_patch_node, word, value); } - __clear_cache(_jit->code.ptr, _jit->pc.uc); + word = sysconf(_SC_PAGE_SIZE); + __clear_cache(_jit->code.ptr, (void *)((_jit->pc.w + word) & -word)); return (_jit->code.ptr); } diff --git a/lib/jit_ppc.c b/lib/jit_ppc.c index a09b24fa3..1f1c6b4ba 100644 --- a/lib/jit_ppc.c +++ b/lib/jit_ppc.c @@ -1346,7 +1346,8 @@ _emit_code(jit_state_t *_jit) patch_at(_jitc->patches.ptr[offset].inst, word); } - __clear_cache(_jit->code.ptr, _jit->pc.uc); + word = sysconf(_SC_PAGE_SIZE); + __clear_cache(_jit->code.ptr, (void *)((_jit->pc.w + word) & -word)); return (_jit->code.ptr); }