Skip to content

Commit

Permalink
Fix containsOnlyConstantLoad logic
Browse files Browse the repository at this point in the history
  • Loading branch information
Thushara-Piyasekara committed Nov 9, 2024
1 parent 5c9cc32 commit 7c27f34
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,8 @@ private boolean containsOnlyConstantLoad(BIRNode.BIRFunction defaultFunction) {
}
BIRNode.BIRBasicBlock firstBB = defaultFunction.basicBlocks.get(0);
BIRNode.BIRBasicBlock secondBB = defaultFunction.basicBlocks.get(1);
if (!secondBB.instructions.isEmpty() || secondBB.terminator.kind != InstructionKind.RETURN) {
if (!secondBB.instructions.isEmpty() || secondBB.terminator.kind != InstructionKind.RETURN ||
firstBB.terminator.kind == InstructionKind.CALL) {
return false;
}
return switch (firstBB.instructions.size()) {
Expand Down

0 comments on commit 7c27f34

Please sign in to comment.