Package soot.toolkits.exceptions
Class DuplicateCatchAllTrapRemover
- java.lang.Object
-
- soot.Transformer
-
- soot.BodyTransformer
-
- soot.toolkits.exceptions.DuplicateCatchAllTrapRemover
-
public class DuplicateCatchAllTrapRemover extends BodyTransformer
Some compilers generate duplicate traps: Exception table: from to target type 9 30 37 Class java/lang/Throwable 9 30 44 any 37 46 44 any The semantics is as follows: try { // block } catch { // handler 1 } finally { // handler 2 } In this case, the first trap covers the block and jumps to handler 1. The second trap also covers the block and jumps to handler 2. The third trap covers handler 1 and jumps to handler 2. If we treat "any" as java.lang. Throwable, the second handler is clearly unnecessary. Worse, it violates Soot's invariant that there may only be one handler per combination of covered code region and jump target. This transformer detects and removes such unnecessary traps.- Author:
- Steven Arzt
-
-
Constructor Summary
Constructors Constructor Description DuplicateCatchAllTrapRemover(Singletons.Global g)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidinternalTransform(Body b, String phaseName, Map<String,String> options)This method is called to perform the transformation itself.static DuplicateCatchAllTrapRemoverv()-
Methods inherited from class soot.BodyTransformer
transform, transform, transform
-
-
-
-
Constructor Detail
-
DuplicateCatchAllTrapRemover
public DuplicateCatchAllTrapRemover(Singletons.Global g)
-
-
Method Detail
-
v
public static DuplicateCatchAllTrapRemover v()
-
internalTransform
protected void internalTransform(Body b, String phaseName, Map<String,String> options)
Description copied from class:BodyTransformerThis method is called to perform the transformation itself. It is declared abstract; subclasses must implement this method by making it the entry point to their actual Body transformation.- Specified by:
internalTransformin classBodyTransformer- Parameters:
b- the body on which to apply the transformationphaseName- the phasename for this transform; not typically used by implementations.options- the actual computed options; a combination of default options and Scene specified options.
-
-