[Soot-list] my StrongLocalMustAliasAnalysis gives unexpected results

Eric Bodden eric.bodden at ec-spride.de
Thu Oct 11 05:49:49 EDT 2012


Hello.


> If I understand well, the following contract holds for any object 'slmaa' of
> the  class StrongLocalMustAliasAnalysis:
>
>           slmaa.instanceKey(loc, stmt) != UNKNOWN
> ===> 'loc' strongly must-alias with itself
>  ( or equivalently, at most one run-time object can be bound to 'loc' )

I think that may be the cause of the problem. Your assumption does not
actually hold. There's an additional condition. See here in the
implementation:

    public boolean mustAlias(Local l1, Stmt s1, Local l2, Stmt s2) {
        Object l1n = getFlowBefore(s1).get(l1);
        Object l2n = getFlowBefore(s2).get(l2);

        if (l1n == UNKNOWN || l2n == UNKNOWN ||
            invalidInstanceKeys.contains(l1n) ||
invalidInstanceKeys.contains(l2n))
            return false;

        return l1n == l2n;
    }

In your example, $r0 quite likely got invalidated.

Eric


More information about the Soot-list mailing list