[Soot-list] cast soot.SootClass to Local variable

Zhang Yixi zhangy16 at rpi.edu
Mon Nov 30 22:07:31 EST 2009


Hi all,

I'm trying to fix my code for a programming assignment. My question is how to convert the SootClass static_class to a soot.Value variable can use as the newStaticInvokeExpr()'s third argument. The restriction is cant use ClassConstant.v() because our remote machine doesn't support that. What I have is

private static String tracker_name = "RuntimeTracker";
private static SootMethod before_call_vi;
tracker_class = Scene.v().getSootClass(tracker_name);
before_call_vi =tracker_class.getMethod("void beforeCall(java.lang.String,java.lang.Object)");
Value receiver_expr = ((InstanceInvokeExpr)c).getBase();
Type static_type = receiver_expr.getType();
SootClass static_class = ((RefType)static_type).getSootClass();
sc = Jimple.v().newStaticInvokeExpr(before_call_vi,StringConstant.v(call_id),static_class);

The compile error is 

"Explicit cast needed to convert soot.SootClass to soot.Value."
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.cs.mcgill.ca/pipermail/soot-list/attachments/20091130/49efe886/attachment.html 


More information about the Soot-list mailing list