Fix for incorrect goto/16 to goto/32 conversion.

This commit is contained in:
Izzat Bahadirov 2013-03-25 16:44:32 -04:00
parent add494945d
commit 6e524ece32

View File

@ -193,7 +193,7 @@ public class InstructionWriteUtil {
} else if (instruction.getOpcode().format.equals(Format.Format20t) && !offsetToNewInstructionMap.containsKey(currentCodeOffset)) { } else if (instruction.getOpcode().format.equals(Format.Format20t) && !offsetToNewInstructionMap.containsKey(currentCodeOffset)) {
int targetOffset = ((Instruction20t)instruction).getCodeOffset(); int targetOffset = ((Instruction20t)instruction).getCodeOffset();
int codeOffsetDelta = codeOffsetShift(currentCodeOffset); int codeOffsetDelta = codeOffsetShift(currentCodeOffset);
int newTargetOffset = targetOffsetShift(currentCodeOffset, targetOffset); int newTargetOffset = targetOffset + targetOffsetShift(currentCodeOffset, targetOffset);
if ((short)newTargetOffset != newTargetOffset) { if ((short)newTargetOffset != newTargetOffset) {
codeOffsetShifts.add(codeOffsetDelta, currentCodeOffset+instruction.getCodeUnits()); codeOffsetShifts.add(codeOffsetDelta, currentCodeOffset+instruction.getCodeUnits());
offsetToNewInstructionMap.put(currentCodeOffset, Format.Format30t); offsetToNewInstructionMap.put(currentCodeOffset, Format.Format30t);