[Soot-list] Duplicating Locals!!
M Alsob
m99m20 at hotmail.com
Fri Feb 21 12:35:30 EST 2014
Hi all,I am experiencing something odd with soot, and I am wondering whether is it supposed to happen this way or is it a bug in the system,,the code I am running is very simple, it just traverses a method unit graph, it iterates over locals and for each local variable, it outputs the following info:given name, type, definition lines and use lines.. (just using getDefBoxs and getUseBoxes)for some variables the tool outputs two results with different types( e.g. w and y ) and for some it duplicates them and outputs them as two different vars( e.g. x)!!
why is that happening and is there a way to fix that??Thanx..
this is a snapshot of the code in the java file:
38: int w = 5, y,x,z;39: y=w-1;40: x = 3+y;41: z = x*y;42: if(y>0)43: {44: z=x++;45: if(someCondtionThatDoesNotIncludeTheVars))46: while(w>y)47: {48: y += 10;49: fun(y);50: }51: else52: fun(y);53: }54: x = z*z;55: w = x;56: y = 0;
and this is some of the result:
-- Variable: w, Type: byte = { Definition Lines: [[38, 38]] Use Lines: [[39, 39], [46]]}
-- Variable: y, Type: int = { Definition Lines: [[39, 39], [48]] Use Lines: [[40, 40], [41, 41], [42], [48], [49], [46], [52]]}
-- Variable: x, Type: int = { Definition Lines: [[40, 40]] Use Lines: [[41, 41], [44], [44, 44]]}
-- Variable: z, Type: int = { Definition Lines: [[41, 41], [44, 44]] Use Lines: [[54, 54], [54, 54], [58]] }
-- Variable: x, Type: int = { Definition Lines: [[44], [54, 54]] Use Lines: [[55, 55], [58], [58]]}
-- Variable: w, Type: int = { Definition Lines: [[55, 55]] Use Lines: [[58]]}
-- Variable: y, Type: boolean = { Definition Lines: [[56, 56]] Use Lines: []}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.cs.mcgill.ca/pipermail/soot-list/attachments/20140221/3311a7dc/attachment.html
More information about the Soot-list
mailing list