Skip to content

Commit b74fa73

Browse files
authored
Merge pull request #195 from nevillegrech/minor_cloning_helper
Add another FallthroughBlockUsedMultipleTimes clone helper case.
2 parents 79803eb + f7a8c34 commit b74fa73

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

logic/local_components.dl

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -655,6 +655,14 @@ IsStackIndexLessThan(n, maximum) :- n = range(0, maximum, 1).
655655
BasicBlock_Head(next, fallthrough),
656656
block1 != block2.
657657

658+
// Stack balance block is fallthrough and also used elsewhere. Make it a jump so it can be cloned.
659+
FallthroughBlockUsedMultipleTimes(block, fallthrough):-
660+
JumplessFalthroughBlock(block, next),
661+
StackBalanceBlock(next),
662+
(BlockPushesLabel(otherBlock, as(next, Value)); StaticBlockJumpTarget(otherBlock, as(next, Value))),
663+
BasicBlock_Head(next, fallthrough),
664+
block != otherBlock.
665+
658666
.decl CODECOPYStatement(stmt: Statement, offset: Value, size: Value)
659667
CODECOPYStatement(codeCopy, codeOffsetNumHex, smallNumHex) :-
660668
Statement_Opcode(codeCopy, "CODECOPY"),

0 commit comments

Comments
 (0)