Ejemplo n.º 1
0
 /*
  * @see com.ibm.wala.dataflow.IFDS.ISupergraph#isCall(java.lang.Object)
  */
 public boolean isCall(Statement n) {
   switch (n.getKind()) {
     case EXC_RET_CALLEE:
     case EXC_RET_CALLER:
     case HEAP_PARAM_CALLEE:
     case NORMAL_RET_CALLEE:
     case NORMAL_RET_CALLER:
     case PARAM_CALLEE:
     case PHI:
     case HEAP_RET_CALLEE:
     case HEAP_RET_CALLER:
     case METHOD_ENTRY:
     case METHOD_EXIT:
     case CATCH:
     case PI:
       return false;
     case HEAP_PARAM_CALLER:
     case PARAM_CALLER:
       return true;
     case NORMAL:
       if (sdg.getCOptions().equals(ControlDependenceOptions.NONE)) {
         return false;
       } else {
         NormalStatement s = (NormalStatement) n;
         return s.getInstruction() instanceof SSAAbstractInvokeInstruction;
       }
     default:
       Assertions.UNREACHABLE(n.getKind() + " " + n.toString());
       return false;
   }
 }
Ejemplo n.º 2
0
 /*
  * @see com.ibm.wala.dataflow.IFDS.ISupergraph#getReturnSites(java.lang.Object)
  */
 public Iterator<? extends Statement> getReturnSites(Statement call, PDG callee) {
   switch (call.getKind()) {
     case PARAM_CALLER:
       {
         ParamCaller n = (ParamCaller) call;
         SSAAbstractInvokeInstruction st = n.getInstruction();
         PDG pdg = getProcOf(call);
         return pdg.getCallerReturnStatements(st).iterator();
       }
     case HEAP_PARAM_CALLER:
       {
         HeapStatement.HeapParamCaller n = (HeapStatement.HeapParamCaller) call;
         SSAAbstractInvokeInstruction st = n.getCall();
         PDG pdg = getProcOf(call);
         return pdg.getCallerReturnStatements(st).iterator();
       }
     case NORMAL:
       {
         NormalStatement n = (NormalStatement) call;
         SSAAbstractInvokeInstruction st = (SSAAbstractInvokeInstruction) n.getInstruction();
         PDG pdg = getProcOf(call);
         return pdg.getCallerReturnStatements(st).iterator();
       }
     default:
       Assertions.UNREACHABLE(call.getKind().toString());
       return null;
   }
 }