[Soot-list] [Soot] identify write operation on Local

Linghui Luo linghui.luo at uni-paderborn.de
Wed Feb 21 20:46:34 EST 2018


Hi Umar,
You can get the left side and right side of AssignStmt in soot using getLeftOp() and getRightOp(). The return value of these two functions are of type Value. Just check the subinterfaces of Value, you will find InstanceFieldRef. Assume you have an AssignStmt called a, here is an example for your purpose:

Value leftOp=a.getLeftOp();
if(leftOp instanceof Local)
               //assignment to a local.
else if(leftOp instanceof InstanceFieldRef)
               //assignment to an instance field.

Best regards,
Linghui Luo

Von: Soot-list [mailto:soot-list-bounces at CS.McGill.CA] Im Auftrag von Umar Farooq
Gesendet: Donnerstag, 22. Februar 2018 00:58
An: soot-list at cs.mcgill.ca
Betreff: [Soot-list] [Soot] identify write operation on Local

Hi All,

I want to identify the read and write operations on local. In order to  identify a write operation, it can be a simple assignment to object or it can any small update like "object.a = 11". Similar for the read, it can be complete object or some part of it.

Is there any API or helper method inside the Soot that can help me out for this purpose?

Thanks,
Umar
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.CS.McGill.CA/pipermail/soot-list/attachments/20180222/2f175e6d/attachment.html>


More information about the Soot-list mailing list