|
From: <sv...@va...> - 2013-01-20 18:16:53
|
petarj 2013-01-20 18:16:45 +0000 (Sun, 20 Jan 2013)
New Revision: 2648
Log:
mips: fix for mips-disassembler when branch is at block_size-2 position
Check if the last instruction in the block is a branch or jump instruction
should happen only if the disassembler was not already stopped.
Incorrect conditional led to a boundary case in which jumps/branches were not
executed when placed on "max_insns - 2" position in the block.
none/tests/mips32/block_size test will be added to Valgrind to describe the case
and check for regressions in future.
Modified files:
trunk/priv/guest_mips_toIR.c
Modified: trunk/priv/guest_mips_toIR.c (+3 -2)
===================================================================
--- trunk/priv/guest_mips_toIR.c 2013-01-20 11:39:52 +00:00 (rev 2647)
+++ trunk/priv/guest_mips_toIR.c 2013-01-20 18:16:45 +00:00 (rev 2648)
@@ -3622,12 +3622,13 @@
// On MIPS we need to check if the last instruction
// in block is branch or jump
- if ((vex_control.guest_max_insns - 1) == (delta+4)/4)
+ if (((vex_control.guest_max_insns - 1) == (delta + 4) / 4)
+ && (dres.whatNext != Dis_StopHere))
if (branch_or_jump(guest_code + delta + 4)) {
dres.whatNext = Dis_StopHere;
dres.jk_StopHere = Ijk_Boring;
putPC(mkU32(guest_PC_curr_instr + 4));
- }
+ }
dres.len = 4;
DIP("\n");
|