Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  /*
   * Copyright (C) 2015 The Pennsylvania State University and the University of Wisconsin
   * Systems and Internet Infrastructure Security Laboratory
   *
   * Author: Damien Octeau
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
  *
  * http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
 package edu.psu.cse.siis.coal;
 
 
 import java.util.Map;
 import java.util.Set;
 
 import soot.NullType;
 import soot.Scene;
 import soot.Unit;
 import soot.Value;
Definition of the IDE problem for MVMF constant propagation.
 
 public class PropagationProblem
     extends
   public static final EdgeFunction<BasePropagationValueALL_TOP = new AllTopEdgeFunction();
 
   private final Set<UnitinitialSeeds = new HashSet<Unit>();
   private final PointsToAnalysis pointsToAnalysis = Scene.v().getPointsToAnalysis();
 
   /*
    * Edge and flow function factories.
    */
       new CallToReturnEdgeFunctionFactory();
       new CallToReturnFlowFunctionFactory();
 
     super(icfg);
     this. = icfg;
   }
 
   public Set<UnitgetInitialSeeds() {
     return ;
   }
 
   @Override
     return new PropagationLattice();
   }

  
Factory for edge functions.

Returns:
The edge functions.
 
   @Override
       createEdgeFunctionsFactory() {
     return new EdgeFunctions<UnitValueSootMethodBasePropagationValue>() {
 
       @Override
       public EdgeFunction<BasePropagationValuegetNormalEdgeFunction(Unit currValue currNode,
           Unit succValue succNode) {
         return .getNormalEdgeFunction(currcurrNodesuccNode,
             zeroValue(), );
       }
 
      @Override
      public EdgeFunction<BasePropagationValuegetCallEdgeFunction(Unit callStmtValue srcNode,
          SootMethod destinationMethodValue destNode) {
        // TODO (Damien): maybe activate again?
        // InvokeExpr invokeExpr = ((Stmt) callStmt).getInvokeExpr();
        //
        // for (int i = 0; i < destinationMethod.getParameterCount(); ++i) {
        // if (invokeExpr.getArg(i) instanceof NullConstant && srcNode.equals(zeroValue())
        // && destNode.equals(destinationMethod.getActiveBody().getParameterLocal(i))) {
        // PropagationTransformer propagationTransformer = new PropagationTransformer();
        // propagationTransformer.addBranchTransformer(NullBranchTransformer.v());
        // }
        // }
        return EdgeIdentity.v();
      }
      @Override
          SootMethod calleeMethodUnit exitStmtValue exitNodeUnit returnSiteValue retNode) {
        return EdgeIdentity.v();
      }
      @Override
          Value callNodeUnit returnSiteValue returnSideNode) {
        return .getCallToReturnEdgeFunction(callSitecallNode,
            returnSitereturnSideNode);
      }
    };
  }

  
Factory for flow functions.

Returns:
The flow functions.
    return new FlowFunctions<UnitValueSootMethod>() {
      @Override
      public FlowFunction<ValuegetNormalFlowFunction(Unit srcUnit dest) {
        return .getNormalFlowFunction(srcdestzeroValue(),
            );
      }
      @Override
      public FlowFunction<ValuegetCallFlowFunction(Unit srcfinal SootMethod dest) {
        return .getCallFlowFunction(srcdestzeroValue());
      }
      @Override
      public FlowFunction<ValuegetReturnFlowFunction(Unit callSiteSootMethod callee,
          Unit exitStmtUnit retSite) {
        return .getReturnFlowFunction(callSitecalleeexitStmtretSite,
            zeroValue());
      }
      @Override
      public FlowFunction<ValuegetCallToReturnFlowFunction(Unit callUnit returnSite) {
        return .getCallToReturnFlowFunction(callreturnSite,
            zeroValue(), );
      }
    };
  }
  public Value createZeroValue() {
    return new JimpleLocal("zero", NullType.v());
  }
  public Map<UnitSet<Value>> initialSeeds() {
    return DefaultSeeds.make(zeroValue());
  }
    return ;
  }
New to GrepCode? Check out our FAQ X