From f63d064a10b7f366f519d301600d9040c7bc1a17 Mon Sep 17 00:00:00 2001 From: Paulo Andrade Date: Sun, 21 Dec 2014 20:55:19 -0200 Subject: [PATCH] ARM: Correct constants offset check * lib/jit_arm.c: Correct check to guard overflow of index of constants from program counter. --- ChangeLog | 5 +++++ lib/jit_arm.c | 4 +++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 1fb41d341..d10780ab3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2014-12-21 Paulo Andrade + + * lib/jit_arm.c: Correct check to guard overflow of index + of constants from program counter. + 2014-11-24 Paulo Andrade * lib/lightning.c: Remove an optimization to calee save diff --git a/lib/jit_arm.c b/lib/jit_arm.c index 66842eeec..d65d248e4 100644 --- a/lib/jit_arm.c +++ b/lib/jit_arm.c @@ -1530,7 +1530,9 @@ _emit_code(jit_state_t *_jit) /* update register live state */ jit_reglive(node); - if (_jitc->consts.length && _jit->pc.uc - _jitc->consts.data >= 3968) { + if (_jitc->consts.length && + (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 &&