[Soot-list] Type merging rules too strong?

Khilan Gudka khilan.gudka at imperial.ac.uk
Fri Mar 7 17:43:09 EST 2008


Dear All,

I'm using the Type.merge method and I have a query about whether soot is too
strict at determining whether a merge is legal or not. In particular, if I
merge a RefType with an ArrayType, the correct result would be Object but
soot throws an exception. Incidentally, it is perfectly fine to cast an
array type to Object in Java. For example, the following is perfectly legal
in Java:

        int[] ints = new int[1];
        Object o = ints;
        ints = (int[])o;
        System.out.println(ints[0]);

At present, the following check in RefType.merge and the implementation of
ArrayType.merge prevents the above type of merge:

        if(! (other instanceof RefType))
            throw new RuntimeException("illegal type merge: "
                                       + this + " and " + other);

Khilan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.CS.McGill.CA/pipermail/soot-list/attachments/20080307/bd9550a3/attachment.htm


More information about the Soot-list mailing list