[Soot-list] How check for method calls such that the method call is defined in a particular class?

Rohan Padhye rohanpadhye at cse.iitb.ac.in
Mon May 27 06:53:08 EDT 2013


Better yet: Check for "containsInvokeExpr()" which is defined in the 
Stmt class. If this is true, then "getInvokeExpr()" will return 
something meaningful.

Regards,
Rohan

On 05/27/2013 12:19 AM, Phil Pratt-Szeliga wrote:
> Hello John,
>
>> I want to check all the statements in a method and for each statement, check whether it contains a method call that comes from the System class or the Math class (e.g., System.out.println or Math.abs). Or if you know how to determine whether the method comes from any class in the standard Java API, that's even better. I need to separate "safe" method calls (e.g., System.out.println) from method calls whose methods are not part of the standard Java API. I suppose if I can identify just method calls from System and Math, that's good enough.
> You can first see if they are either: AssignStmt or InvokeStmt.
>
> If it is AssignStmt, you can pull out the right hand side (rhs) and
> see if it is an InvokeExpr. Also, inside an InvokeStmt is an
> InvokeExpr.
>
> Phil Pratt-Szeliga
> Syracuse University
> http://trifort.org/
> _______________________________________________
> Soot-list mailing list
> Soot-list at sable.mcgill.ca
> http://mailman.cs.mcgill.ca/mailman/listinfo/soot-list



More information about the Soot-list mailing list