Class AddNopStmt

java.lang.Object
soot.jimple.infoflow.codeOptimization.AddNopStmt
All Implemented Interfaces:
ICodeOptimizer

public class AddNopStmt extends Object implements ICodeOptimizer
There is one special case: If a source stmt is a static method without any parameters, which is called from a static method also without any parameters (see static2Test), the assign stmt s = staticSource() is be the first statement in the iCFG (excluded the dummy main method). The CallToReturn flow function only gets applied if a return site is available. In backwards analysis the iCFG is reversed and the assign stmt therefore has no return site. But we need the execution of the CallToReturn flow function to register the arrival at the source. To fix this edge case, we add a NOP in static methods called from an entry point.
  • Constructor Details

    • AddNopStmt

      public AddNopStmt()
  • Method Details

    • initialize

      public void initialize(InfoflowConfiguration config)
      Description copied from interface: ICodeOptimizer
      Initializes the code optimizer. This method is called before any actual optimizations are carried out.
      Specified by:
      initialize in interface ICodeOptimizer
      Parameters:
      config - The data flow analyzer's configuration
    • run

      public void run(InfoflowManager manager, Collection<soot.SootMethod> entryPoints, ISourceSinkManager sourcesSinks, ITaintPropagationWrapper taintWrapper)
      Description copied from interface: ICodeOptimizer
      Runs the coe optimization
      Specified by:
      run in interface ICodeOptimizer
      Parameters:
      manager - The data flow manager for interacting with the solver
      entryPoints - The set of entry points for the data flow analysis
      sourcesSinks - The SourceSinkManager
      taintWrapper - The taint wrapper