Fixed the bug of not setting the location field of the instruction in addInstruction(i,instruction) method

This commit is contained in:
edwardxwu 2014-08-28 13:57:45 -07:00 committed by Connor Tumbleson
parent 1d597910e2
commit fe42130f05

View File

@ -213,8 +213,10 @@ public class MutableMethodImplementation implements MethodImplementation {
return;
}
int codeAddress = instructionList.get(index).getCodeAddress();
MethodLocation newLoc = new MethodLocation(instruction, codeAddress, index);
instructionList.add(index, newLoc);
instruction.location = newLoc;
instructionList.add(index, new MethodLocation(instruction, codeAddress, index));
codeAddress += instruction.getCodeUnits();
for (int i=index+1; i<instructionList.size(); i++) {