[Soot-list] my StrongLocalMustAliasAnalysis gives unexpected results

Patrick Lam plam at sable.mcgill.ca
Sun Oct 21 00:33:38 EDT 2012


On 10/21/2012 12:25 AM, Zhoulai wrote:
>      > ****************
>      > 1:     static void test5(int i){
>      > 2:         while (i>0){
>      > 3:             A x = new A();
>      > 4:             A y = x;
>      > 5:             String s = "hello";
>      >          }
>      >      }
>      > **************

> By your specification in your paper, the strong representative only
> must-alias itself at the same program location if it is not guaranteed
> that this representative represents a single run-time object.
>
> Here variable 'x'' is associated with  more than 1 run-time objects.  It
> is therefore expected to be bound to UNKNOWN.

x only points to one object at a time in this case. The only way that x 
might point to more than one object is if there are two different 
definitions that reach x (perhaps from different iterations of the 
loop), like if you had this program instead:

     A x = null;
     if (...) x = new A();
     A y = x;

Then you should not get UNKNOWN. But in the program you wrote, there's 
only one object that x could possibly contain.

pat



More information about the Soot-list mailing list