wingo pushed a commit to branch lightning
in repository guile.

commit f63d064a10b7f366f519d301600d9040c7bc1a17
Author: Paulo Andrade <[email protected]>
Date:   Sun Dec 21 20:55:19 2014 -0200

    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 1fb41d3..d10780a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2014-12-21 Paulo Andrade <[email protected]>
+
+       * lib/jit_arm.c: Correct check to guard overflow of index
+       of constants from program counter.
+
 2014-11-24 Paulo Andrade <[email protected]>
 
        * lib/lightning.c: Remove an optimization to calee save
diff --git a/lib/jit_arm.c b/lib/jit_arm.c
index 66842ee..d65d248 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 &&

Reply via email to