return invokeExpr(v, box);
}
@Override
public Variable caseSpecialInvokeExpr(SpecialInvokeExpr v, ValueBox box) {
Variable callee = translateExpression(v.getBaseBox());
// evaluate all arguments
List<Variable> arguments = new ArrayList<Variable>();
for (int i=0; i<v.getArgCount(); i++) {
arguments.add(translateExpression(v.getArgBox(i)));
}
// if the called class could not be found (ie a phantom class), treat it as a corrupt call
if (v.getMethodRef().declaringClass().isPhantom()) {
return handlePhantomInvocation(v, arguments);
}
SootMethod method = v.getMethod();
// Is this a constructor call?
if (method.getName().equals("<init>")) {
return handleConstructor(v, callee, arguments);
}
// try to handle it as an abstract method call. even though we know the exact target,
// this is the correct thing to do according to the MethodCallTranslator interface.
Variable result = methodCallTranslator.translateAbstractMethodCall(v, method, callee, arguments, factory);
if (result != null)
return result;
// Otherwise just handle it as a normal call with only one possible target
result = makeVariable(getType(v.getMethod().getReturnType()));