Class TrapTightener

java.lang.Object
sootup.interceptors.TrapTightener
All Implemented Interfaces:
BodyInterceptor

public class TrapTightener extends Object implements 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 Details

    • TrapTightener

      public TrapTightener()
  • Method Details