[Soot-list] def-use for a particular jimple variable

Steven Arzt Steven.Arzt at cased.de
Wed Jul 29 08:23:39 EDT 2015


Hi Earlence,

 

The SimpleLocalDefs class is used to scan a method for definitions of some local at points where the respective local is live. Take the following example:

 

                a = 42;

                foo(a);

 

At line 2, I can ask SimpleLocalDefs to give me the definitions of local “a” and it will give me the first line. At line 1 itself, it does not make sense to ask which definition of “a” is used here – “a” isn’t used there at all, it’s only overwritten. In other words, the query is a reaching-definitions query.

 

If you want to know what the current line defines, use Unit.getDefBoxes().

 

Best regards,

  Steven

 

Von: soot-list-bounces at CS.McGill.CA [mailto:soot-list-bounces at CS.McGill.CA] Im Auftrag von Earlence Fernandes
Gesendet: Mittwoch, 29. Juli 2015 04:41
An: soot-list at CS.McGill.CA
Betreff: [Soot-list] def-use for a particular jimple variable

 

I'm using SimpleLocalDefs to compute the defs for a local in a method. I am also trying to process statements of the form

 

var = result of some invoke expression with arg1, arg2, etc

 

So I query the Local defs object with var, arg1 and arg2. However, I get the following error:

 

Illegal LocalDefs query; local r1 has no definition at r1 = staticinvoke <com.microsoft.st.compilationshell.STShell: org.codehaus.groovy.runtime.callsite.CallSite[] $getCallSiteArray()>()

 

What is the cause of this error? Clearly, r1 is being assigned the return value of the invoke. Does it have to do with the fact that the invocation is static? If so, how do I process such statements?

 

-earlence

-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://mailman.CS.McGill.CA/pipermail/soot-list/attachments/20150729/3cfacbe7/attachment.html 


More information about the Soot-list mailing list