Refactoring: ControlFlowInstructionsGenerator.handleJumpInsideTryFinally
This commit is contained in:
+7
-10
@@ -200,18 +200,15 @@ class ControlFlowInstructionsGenerator : ControlFlowBuilderAdapter() {
|
|||||||
private fun handleJumpInsideTryFinally(jumpTarget: Label) {
|
private fun handleJumpInsideTryFinally(jumpTarget: Label) {
|
||||||
val finallyBlocks = ArrayList<TryFinallyBlockInfo>()
|
val finallyBlocks = ArrayList<TryFinallyBlockInfo>()
|
||||||
|
|
||||||
for (i in allBlocks.indices.reversed()) {
|
for (blockInfo in allBlocks.asReversed()) {
|
||||||
val blockInfo = allBlocks[i]
|
when (blockInfo) {
|
||||||
if (blockInfo is BreakableBlockInfo) {
|
is BreakableBlockInfo -> if (blockInfo.referablePoints.contains(jumpTarget) || jumpTarget === error) {
|
||||||
if (blockInfo.referablePoints.contains(jumpTarget) || jumpTarget === error) {
|
for (finallyBlockInfo in finallyBlocks) {
|
||||||
for (j in finallyBlocks.indices) {
|
finallyBlockInfo.generateFinallyBlock()
|
||||||
finallyBlocks[j].generateFinallyBlock()
|
|
||||||
}
|
}
|
||||||
break
|
return
|
||||||
}
|
}
|
||||||
}
|
is TryFinallyBlockInfo -> finallyBlocks.add(blockInfo)
|
||||||
else if (blockInfo is TryFinallyBlockInfo) {
|
|
||||||
finallyBlocks.add(blockInfo)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user