Package sootup.interceptors
Class TrapTightener
java.lang.Object
sootup.interceptors.TrapTightener
- All Implemented Interfaces:
BodyInterceptor
Removes exceptional flows that can not be taken at runtime: an exceptional edge of a Stmt to a
handler catching
T is removed if no exception the Stmt might throw can be caught as
T. Afterwards trap handlers which became unreachable are removed.
In Soot, the TrapTightener shrinks the protected range of each Trap so that it begins at the
first and ends after the last unit which might throw an exception caught by the Trap. In SootUp
the Traps are derived from the exceptional flows of the ControlFlowGraph, so the
exceptional flows are tightened per Stmt instead, which can split a Trap into several ones.
The exceptions a Stmt might throw are inferred intraprocedurally by the StmtExceptionAnalyzer. As every Stmt might throw an asynchronous VirtualMachineError,
flows to catch-all handlers (e.g. the handlers releasing a monitor of a synchronized block) and
handlers of Error are always kept.
- Author:
- Zun Wang
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidinterceptBody(@NonNull Body.BodyBuilder builder, @NonNull View view) Takes a BodyBuilder and may apply a transformation to it, for example removing unused local variables.
-
Constructor Details
-
TrapTightener
public TrapTightener()
-
-
Method Details
-
interceptBody
Description copied from interface:BodyInterceptorTakes a BodyBuilder and may apply a transformation to it, for example removing unused local variables.- Specified by:
interceptBodyin interfaceBodyInterceptor
-