Package soot.toolkits.graph

Examples of soot.toolkits.graph.ExceptionalUnitGraph


    Map<String,String> namespaces = new HashMap<String,String>();
    for (SootClass c : Scene.v().getApplicationClasses()) {
      for (SootMethod m : c.getMethods()) {
        if (!m.isConcrete())
          continue;
        DirectedGraph<Unit> mbug = new ExceptionalUnitGraph(m.retrieveActiveBody());
        for (Unit u : mbug) {
          Stmt s1 = (Stmt) u;
          List<Unit> succs = mbug.getSuccsOf(s1);
          if (succs.size() == 1) {
            Stmt s2 = (Stmt) succs.get(0);
            if (s1 instanceof JAssignStmt && s2 instanceof JInvokeStmt && mbug.getPredsOf(s2).size() == 1) {
              JAssignStmt js1 = (JAssignStmt) s1;
              JInvokeStmt js2 = (JInvokeStmt) s2;
              if (js1.containsInvokeExpr()
                  && (js1.getInvokeExpr().getMethod().getSignature().equals("<dk.brics.xact.XML: java.util.Map getNamespaceMap()>")
                      || js1.getInvokeExpr().getMethod().getSignature().equals("<dk.brics.xact.XML: java.util.Map getThreadNamespaceMap()>"))
View Full Code Here


    Map<String,Origin> schemas = new LinkedHashMap<String,Origin>();
    for (SootClass c : Scene.v().getApplicationClasses()) {
      for (SootMethod m : c.getMethods()) {
        if (!m.isConcrete())
          continue;
        DirectedGraph<Unit> mbug = new ExceptionalUnitGraph(m.retrieveActiveBody());
        for (Unit u : mbug) {
          Stmt s = (Stmt) u;
          if (s instanceof JInvokeStmt) {
            JInvokeStmt js = (JInvokeStmt) s;
            if (js.getInvokeExpr().getMethod().getSignature().equals("<dk.brics.xact.XML: void loadXMLSchema(java.lang.String)>")) {
View Full Code Here

     */
    public Collection<SootClass> findWebApps(SootClass webSiteClass) {
        SootMethod initMethod = webSiteClass.getMethodByName("init");
        log.info("Adding web app classes to analysis");
        Set<SootClass> webapps = new HashSet<SootClass>();
        ExceptionalUnitGraph graph = new ExceptionalUnitGraph(
                initMethod.retrieveActiveBody());
        for (Unit aGraph : graph) {
            assert aGraph instanceof Stmt;
            Stmt st = (Stmt) aGraph;
            if (st instanceof JAssignStmt) {
View Full Code Here

    public SimpleLocalDefs getSimpleLocalDefs(Body body) {
        if (simpleLocalDefCache == null)
            simpleLocalDefCache = new HashMap<Body, SimpleLocalDefs>();
        if (!simpleLocalDefCache.containsKey(body)) {
            SimpleLocalDefs simpleLocalDefs = new SimpleLocalDefs(
                    new ExceptionalUnitGraph(body));
            simpleLocalDefCache.put(body, simpleLocalDefs);
        }
        return simpleLocalDefCache.get(body);
    }
View Full Code Here

   
    Method method = jt.getMethod(sootMethod);
    Body body = sootMethod.retrieveActiveBody();
   
    // use an exceptional unit graph for the nullness analysis
        ExceptionalUnitGraph exceptionalFlow = new ExceptionalUnitGraph(body);
        nullAnalysis = new NullnessAnalysis(exceptionalFlow);
       
        // prepare the reaching definitions analysis for the assertion creator
        LiveLocals liveness = new SimpleLiveLocals(exceptionalFlow);
        LocalDefs definitions = new SmartLocalDefs(exceptionalFlow, liveness);
View Full Code Here

        return !isNext;
    }

    private boolean originatesFromNextCall(JCastExpr right, Body body, Stmt st) {
        SimpleLocalDefs simpleLocalDefs = new SimpleLocalDefs(
                new ExceptionalUnitGraph(body));
        List<Unit> defsOfAt = simpleLocalDefs.getDefsOfAt(
                (Local) right.getOp(), st);
        // check all definitions, all must be invocations of next()
        for (Unit unit : defsOfAt) {
            if (unit instanceof AssignStmt) {
View Full Code Here

TOP

Related Classes of soot.toolkits.graph.ExceptionalUnitGraph

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.