Delete dead code on last optimization step, otherwise ASM will split exception table on it.
ASM has logic that splits exception tables in MethodWriter.computeAllFrames:
// Loop over all the basic blocks and visit the stack map frames that must be stored in the
// StackMapTable attribute. Also replace unreachable code with NOP* ATHROW, and remove it from
// exception handler ranges.
...
firstHandler = Handler.removeRange(firstHandler, basicBlock, nextBasicBlock);
...
https://gitlab.ow2.org/asm/asm/issues/317867
#KT-28546 Fixed
This commit is contained in:
+2
@@ -66,6 +66,8 @@ class OptimizationMethodVisitor(
|
||||
optimizationTransformer.transform("fake", methodNode)
|
||||
}
|
||||
|
||||
DeadCodeEliminationMethodTransformer().transform("fake", methodNode)
|
||||
|
||||
methodNode.prepareForEmitting()
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user