Skip to content
Snippets Groups Projects
Commit 1ce5e09f authored by Haoyang Cui's avatar Haoyang Cui
Browse files

Update mutants/mutant-5/swen90006/machine/Machine.java

parent 05b11acf
No related branches found
No related tags found
No related merge requests found
...@@ -265,8 +265,13 @@ public class Machine ...@@ -265,8 +265,13 @@ public class Machine
if (toks.length != 2){ if (toks.length != 2){
throw new InvalidInstructionException(); throw new InvalidInstructionException();
} }
int offs = parseOffset(toks[1]); int num = 0;
pc = pc + offs; try {
num = Integer.parseInt(toks[1]);
} catch (Exception e){
throw new InvalidInstructionException();
}
pc = pc + num;
count++; count++;
continue; /* avoid default increment of pc below */ continue; /* avoid default increment of pc below */
} else if (toks[0].equals(INSTRUCTION_JZ)){ } else if (toks[0].equals(INSTRUCTION_JZ)){
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment