Пример #1
0
 @SuppressWarnings("unchecked")
 public static FunctionType getFunctionType(SootMethodRef methodRef) {
   Type returnType = getType(methodRef.returnType());
   Type[] paramTypes =
       new Type[(methodRef.isStatic() ? 1 : 2) + methodRef.parameterTypes().size()];
   int i = 0;
   paramTypes[i++] = ENV_PTR;
   if (!methodRef.isStatic()) {
     paramTypes[i++] = OBJECT_PTR;
   }
   for (soot.Type t : (List<soot.Type>) methodRef.parameterTypes()) {
     paramTypes[i++] = getType(t);
   }
   return new FunctionType(returnType, paramTypes);
 }
 private SootMethodRef remapRef(SootMethodRef ref) {
   Type return_type = fixType(ref.returnType());
   List params = fixParameterList(ref.parameterTypes());
   int modifiers = Modifier.PUBLIC;
   if (ref.isStatic()) {
     modifiers += Modifier.STATIC;
   }
   SootMethod method = new SootMethod(ref.name(), params, return_type, modifiers);
   SootClass decl_class = ref.declaringClass();
   if (shouldMap(decl_class)) {
     decl_class = getMapping(decl_class);
   }
   method.setDeclaringClass(decl_class);
   return method.makeRef();
 }
Пример #3
0
 public BSpecialInvokeInst(SootMethodRef methodRef) {
   if (methodRef.isStatic()) throw new RuntimeException("wrong static-ness");
   this.methodRef = methodRef;
 }