[Soot-list] my StrongLocalMustAliasAnalysis gives unexpected results

Eric Bodden eric.bodden at ec-spride.de
Sat Oct 27 08:38:55 EDT 2012


Hello.

> Eric, I am not quite sure the new fixed StrongLocalMustAliasAnalysis is
> already sound.
>
> Let us slightly modify your test case above. Here it is the test-case I am
> using:
>
>     void test(int i, A c){
>         A b= new A();
>         while (i>0){
>             A a = new A();
>             A x = a;
>             c = b;
>             String tag="TAG";
>         }
>     }
>
> Your  StrongLocalMustAliasAnalysis associates 'c' with UNKNOWN  for all the
> control points inside the loop.

Well, first of all, UNKNOWN is always sound - it may just not be as
precise as one would like. Probably that's what you mean...

> However, for the first three lines of the loop, I think 'c' has potentially
> more than one value, the one  the function parameter,  and the one from 'b'.

Correct.

> So, 'c' should be bound to UNKNOWN only for the last two lines.  Did I
> misunderstand something? If not, I may have some suggestions on how to avoid
> this problem .

I am afraid, I don't quite follow. As you correctly say, c can have
two different values for the first three lines of the loop: either the
parameter (in the first iteration) or the value of b (in any
subsequent iteration). But precisely because of that it would not be
sound to assign "c" a value number at those locations: if we did then
it would appear to must-alias itself, which would be unsound.
If anything then we could assign "c" a value number after line "c =
b;" because after this the value never changes. Here it would be
correct to say that c always must-alias itself in every iteration. I
am not sure what the current implementation gives you for this code
location...

Eric


More information about the Soot-list mailing list