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.
git-svn-id: svn://svn.valgrind.org/vex/trunk@2648
// 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");