Search in sources :

Example 1 with SomeMethodCall

use of dk.brics.soot.intermediate.representation.SomeMethodCall in project soot by Sable.

the class ExprTranslator method handleCall.

// For a single target, foo-type or not, non-special
void handleCall(InvokeExpr expr, SootMethod target) {
    SootClass dc = target.getDeclaringClass();
    if (jt.isApplicationClass(dc)) {
        if (!dc.isInterface()) {
            // Target in an application class.
            // Setup call to translated method.
            Method method = jt.methodsignaturToMethod.get(target.getSignature());
            SomeMethodCall smc = new SomeMethodCall(method, getArgs(target));
            st.addStatement(smc);
        } else {
            // Call to interface method or abstract method as target.
            // Only occurs if no implementions are found.
            // Arguments are evaluated and nothing is returned.
            jt.notSupported("We don't support interface calls");
        }
    } else {
        // Target in non-application class.
        // We should Escape all arguments and corrupt result.
        // So this might not be what we want.
        Method method = new Method(target.getName(), getArgs(target));
        SomeMethodCall smc = new SomeMethodCall(method, getArgs(target));
        st.addStatement(smc);
        return;
    }
}
Also used : SootMethod(soot.SootMethod) Method(dk.brics.soot.intermediate.representation.Method) SomeMethodCall(dk.brics.soot.intermediate.representation.SomeMethodCall) SootClass(soot.SootClass)

Aggregations

Method (dk.brics.soot.intermediate.representation.Method)1 SomeMethodCall (dk.brics.soot.intermediate.representation.SomeMethodCall)1 SootClass (soot.SootClass)1 SootMethod (soot.SootMethod)1