ARM7: Fix regression with Thumb branches
Jeffrey Pfau jeffrey@endrift.com
Wed, 21 Oct 2015 19:57:29 -0700
1 files changed,
2 insertions(+),
2 deletions(-)
jump to
M
src/arm/isa-thumb.c
→
src/arm/isa-thumb.c
@@ -308,8 +308,8 @@
#define DEFINE_CONDITIONAL_BRANCH_THUMB(COND) \ DEFINE_INSTRUCTION_THUMB(B ## COND, \ if (ARM_COND_ ## COND) { \ - uint8_t immediate = opcode; \ - cpu->gprs[ARM_PC] += immediate << 1; \ + int8_t immediate = opcode; \ + cpu->gprs[ARM_PC] += (int32_t) immediate << 1; \ THUMB_WRITE_PC; \ })