Correct wrong test and update of arm thumb offset information. - lightning.git - Portable just-in-time compiler library

index : lightning.git
Portable just-in-time compiler library
summary refs log tree commit diff
diff options
context:
space:
mode:
authorpcpa <paulo.cesar.pereira.de.andrade@gmail.com>2013年08月29日 17:08:05 -0300
committerpcpa <paulo.cesar.pereira.de.andrade@gmail.com>2013年08月29日 17:08:05 -0300
commitb8770059dc1872567e76a827d461e45dc67f6462 (patch)
treeac657e22e976c620aab59b4b03bf7ce92ce3dd74
parentba182b139aa53fa70dd44fea9f74f777f3c683f7 (diff)
downloadlightning-b8770059dc1872567e76a827d461e45dc67f6462.tar.gz
Correct wrong test and update of arm thumb offset information.
* 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.
Diffstat
-rw-r--r--ChangeLog 8
-rw-r--r--lib/jit_arm-cpu.c 2
-rw-r--r--lib/jit_arm.c 1
3 files changed, 10 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index d1407a2..f16d30c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2013年08月29日 Paulo Andrade <pcpa@gnu.org>
+
+ * 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 <pcpa@gnu.org>
* configure.ac: Extend FreeBSD test to also handle NetBSD.
diff --git a/lib/jit_arm-cpu.c b/lib/jit_arm-cpu.c
index c324f00..71d178d 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 59c9d93..1cc444f 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();
generated by cgit v1.2.3 (git 2.39.1) at 2025年09月21日 20:40:02 +0000

AltStyle によって変換されたページ (->オリジナル) /