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

Zell zell08v at orange.fr
Sat Aug 4 16:16:06 EDT 2012


Hi,

a workaround might be to track locals that are on the left hand side of
IdentityStmt. Of course, cases like x:=@this should be excluded.

I have not tried this.

Cheers,
Zell.

On Sat, Aug 4, 2012 at 9:37 PM, John Dean <jdean4 at kc.rr.com> wrote:

> 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
>
> _______________________________________________
> Soot-list mailing list
> Soot-list at sable.mcgill.ca
> http://mailman.cs.mcgill.ca/mailman/listinfo/soot-list
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.cs.mcgill.ca/pipermail/soot-list/attachments/20120804/5719e72f/attachment.html 


More information about the Soot-list mailing list