[Soot-list] Wrong line number of returned expression

Heejong Lee heejong at gmail.com
Mon Oct 11 22:10:34 EDT 2010


Hi, I don't understand why this happens.
When I transform return expression to corresponding jimple statement, the
line directive it shows goes wrong. For instance,

35  int intra5(Object x) {
36    if (x == null) {
37      return x.hashCode();
38    }
39    return 0;
40  }

>>> (with -f jimple -print-tags)

256 /*[x]*/
257     int intra5(java.lang.Object)
258     {
259         FindBugs this;
260         java.lang.Object x;
261         int temp$0, temp$1;
262
263         this := @this: FindBugs;
264 /*Source Line Pos Tag: sline: 35 eline: 40 spos: 5 epos: 5 file:
FindBugs.java*/
265         x := @parameter0: java.lang.Object;
266 /*Source Line Pos Tag: sline: 35 eline: 35 spos: 16 epos: 23 file:
FindBugs.java*/
267         if x == null goto label0;
268 /*Source Line Pos Tag: sline: 36 eline: 36 spos: 6 epos: 14 file:
FindBugs.java*/
269
270         goto label1;
271 /*Source Line Pos Tag: sline: 36 eline: 36 spos: 6 epos: 14 file:
FindBugs.java*/
272
273      label0:
274         nop;
275 /*Source Line Pos Tag: sline: 36 eline: 36 spos: 6 epos: 14 file:
FindBugs.java*/
276         temp$0 = virtualinvoke x.<java.lang.Object: int hashCode()>();
277 /*Source Line Pos Tag: sline: 36 eline: 36 spos: 6 epos: 14 file:
FindBugs.java*/
278         return temp$0;
279 /*Source Line Pos Tag: sline: 37 eline: 37 spos: 6 epos: 25 file:
FindBugs.java*/
280
281      label1:
282         nop;
283 /*Source Line Pos Tag: sline: 37 eline: 37 spos: 6 epos: 25 file:
FindBugs.java*/
284         temp$1 = 0;
285 /*Source Line Pos Tag: sline: 37 eline: 37 spos: 6 epos: 25 file:
FindBugs.java*/
286         return temp$1;
287 /*Source Line Pos Tag: sline: 39 eline: 39 spos: 2 epos: 10 file:
FindBugs.java*/
288     }

Does anybody know why 276 line of this jimple statement shows line number 36
of original source? IMO, 276 and 278 lines should indicate same 36 line
since they're decomposed from same original return expression.

Regards,

-- 
Heejong Lee

Associate Research Engineer
Program Analysis Division
Fasoo.com, Inc. (www.spa-arrow.com)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.cs.mcgill.ca/pipermail/soot-list/attachments/20101012/af442e5b/attachment-0006.html 


More information about the Soot-list mailing list