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

Phil Pratt-Szeliga pcpratts at trifort.org
Sun May 26 14:49:22 EDT 2013


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/


More information about the Soot-list mailing list