Skip to content

Commit

Permalink
dont call changeStackLocal when we already know its the same stacklocal
Browse files Browse the repository at this point in the history
  • Loading branch information
swissiety committed Dec 22, 2023
1 parent d453781 commit ffb873c
Showing 1 changed file with 11 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,18 @@ void mergeOutput(@Nonnull Operand outputOperand) {
if (output == null) {
output = outputOperand;
} else if (output.stackLocal != null) {
if (output.stackLocal != outputOperand.stackLocal && outputOperand.stackLocal != null) {
throw new IllegalStateException("Incompatible StackLocals. There already exists more than one StackLocal (" + outputOperand.stackLocal + " != " + output.stackLocal+").");
if (outputOperand.stackLocal == null) {
outputOperand.changeStackLocal(output.stackLocal);
} else {
if (output.stackLocal != outputOperand.stackLocal) {
throw new IllegalStateException(

Check warning on line 76 in sootup.java.bytecode/src/main/java/sootup/java/bytecode/frontend/OperandMerging.java

View check run for this annotation

Codecov / codecov/patch

sootup.java.bytecode/src/main/java/sootup/java/bytecode/frontend/OperandMerging.java#L76

Added line #L76 was not covered by tests
"Incompatible stacklocal mismatch. There exist multiple, different possible output Locals ("
+ outputOperand.stackLocal
+ ", "
+ output.stackLocal
+ ").");
}
}
outputOperand.changeStackLocal(output.stackLocal);
}
}

Expand Down

0 comments on commit ffb873c

Please sign in to comment.