[Soot-list] How retrieve a method's list of parameters?

John Dean jdean4 at kc.rr.com
Sat Aug 4 15:37:00 EDT 2012


Hi all,
I need to be able to tell if a variable is a parameter (passed to a method)
as opposed to a regular local variable.
Initially, I tried to identify a parameter by using instanceof ParameterRef,
but that doesn't work. Testing tells me that parameter variables are
instances of JimpleLocal and not ParameterRef.

I've now discovered that I can use Body.getParameterLocal(0) to retrieve the
first parameter. But if I want to compare my variable to all the retrieved
getParameterLocal  variables, I would have to have to be able to retrieve
all the parameters, and I don't know how to do that. If I knew the number of
parameters, I could loop through all the parameters, but I don't know how to
retrieve the number of parameters.

Suggestions?

Thanks,
John



More information about the Soot-list mailing list