Skip to content

Commit

Permalink
Merge pull request #785 from soot-oss/fix/outputOperandsMergingIfSame…
Browse files Browse the repository at this point in the history
…Local

fix merging outputLocals when they are refering to the same Local
  • Loading branch information
kadirayk authored Dec 22, 2023
2 parents bc81639 + ffb873c commit 23e5a3e
Showing 1 changed file with 11 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,18 @@ final class OperandMerging {
void mergeOutput(@Nonnull Operand outputOperand) {
if (output == null) {
output = outputOperand;
} else {
if (output.stackLocal != null) {
assert outputOperand.stackLocal == null;
} else if (output.stackLocal != null) {
if (outputOperand.stackLocal == null) {
outputOperand.changeStackLocal(output.stackLocal);
} else {
if (output.stackLocal != outputOperand.stackLocal) {
throw new IllegalStateException(
"Incompatible stacklocal mismatch. There exist multiple, different possible output Locals ("
+ outputOperand.stackLocal
+ ", "
+ output.stackLocal
+ ").");
}
}
}
}
Expand Down

0 comments on commit 23e5a3e

Please sign in to comment.