From 5eb3c3602f198165e06652ced69fd4d660329bbc Mon Sep 17 00:00:00 2001 From: pcpa Date: Fri, 26 Dec 2014 00:38:54 -0200 Subject: [PATCH] ARM: Better check for constants offset overflow * lib/jit_arm.c: Better check for need to flush constants before the pool being no longer reachable. --- ChangeLog | 5 +++++ lib/jit_arm.c | 5 +++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 13c1363a7..eaa313466 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2014-12-26 Paulo Andrade + + * lib/jit_arm.c: Better check for need to flush constants + before the pool being no longer reachable. + 2014-12-25 Paulo Andrade * include/lightning.h: Split jit_htonr in the new 3 interfaces diff --git a/lib/jit_arm.c b/lib/jit_arm.c index a9a60f235..a77ee93db 100644 --- a/lib/jit_arm.c +++ b/lib/jit_arm.c @@ -1532,8 +1532,9 @@ _emit_code(jit_state_t *_jit) jit_reglive(node); if (_jitc->consts.length && - (jit_uword_t)_jit->pc.uc - - (jit_uword_t)_jitc->consts.patches[0] >= 3968) { + (_jit->pc.uc - _jitc->consts.data >= 3968 || + (jit_uword_t)_jit->pc.uc - + (jit_uword_t)_jitc->consts.patches[0] >= 3968)) { /* longest sequence should be 64 bytes, but preventively * do not let it go past 128 remaining bytes before a flush */ if (node->next &&