[Soot-list] How to determine whether there exists a use for a variable definition later on in the cfg

Cheng Zhang cheng.zhang.stap at gmail.com
Fri Jul 27 11:38:20 EDT 2012


Hi John,

You may use the existing classes, like SimpleLocalDefs or SmartLocalDefs,
to do your work.

Best,
Cheng

On Fri, Jul 27, 2012 at 11:16 PM, John Dean <jdean4 at kc.rr.com> wrote:

> Hi all,
>
> For a given instruction's definition within a loop, I need to determine
> whether there exists a use for that definition outside of the loop. By
> "definition," I mean a variable is assigned a value. By "use," I mean the
> variable is accessed at some later point in the flow of the method's CFG.
> I've already been able to gather the instructions in a loop, so I don't
> need
> help with that.
>
> I've looked through the soot api, and the only strategy I can come up with
> is to find all the instructions in the cfg that might follow the variable
> definition's instruction (while ignoring the instructions in the loop, of
> course). And to do that, I would call cfg.getSuccsOf(unit) recursively and
> avoid infinite recursive loops by storing all the found instructions in a
> list and only adding new instructions if they're not in the list already.
>
> That seems like a lot of work on my part, and I don't want to reinvent the
> wheel if there's a better way. Any 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/20120727/914c503a/attachment.html 


More information about the Soot-list mailing list