Search in sources :

Example 16 with StringConstant

use of soot.jimple.StringConstant in project soot by Sable.

the class MethodNodeFactory method caseStaticInvokeExpr.

@Override
public void caseStaticInvokeExpr(StaticInvokeExpr v) {
    SootMethodRef ref = v.getMethodRef();
    if (v.getArgCount() == 1 && v.getArg(0) instanceof StringConstant && ref.name().equals("forName") && ref.declaringClass().getName().equals("java.lang.Class") && ref.parameterTypes().size() == 1) {
        // This is a call to Class.forName
        StringConstant classNameConst = (StringConstant) v.getArg(0);
        caseClassConstant(ClassConstant.v("L" + classNameConst.value.replaceAll("\\.", "/") + ";"));
    }
}
Also used : SootMethodRef(soot.SootMethodRef) StringConstant(soot.jimple.StringConstant)

Aggregations

StringConstant (soot.jimple.StringConstant)16 Local (soot.Local)10 Value (soot.Value)10 IntConstant (soot.jimple.IntConstant)10 LongConstant (soot.jimple.LongConstant)10 NullConstant (soot.jimple.NullConstant)10 ClassConstant (soot.jimple.ClassConstant)9 DoubleConstant (soot.jimple.DoubleConstant)9 FloatConstant (soot.jimple.FloatConstant)9 BinopExpr (soot.jimple.BinopExpr)8 InvokeExpr (soot.jimple.InvokeExpr)7 Type (soot.Type)6 NewArrayExpr (soot.jimple.NewArrayExpr)6 NewExpr (soot.jimple.NewExpr)6 ArrayType (soot.ArrayType)5 SootMethodRef (soot.SootMethodRef)5 ArrayRef (soot.jimple.ArrayRef)5 CastExpr (soot.jimple.CastExpr)5 InstanceFieldRef (soot.jimple.InstanceFieldRef)5 LengthExpr (soot.jimple.LengthExpr)5