[Soot-list] exception in soot when throwing a null (resend)

Ondrej Lhotak olhotak at sable.mcgill.ca
Wed Sep 21 12:09:15 EDT 2005


On Wed, Sep 14, 2005 at 10:34:36PM -0600, John Jorgensen wrote:
> I'll attach a patch here for your immediate use, but it might not

Thanks, John. I've committed the patch in revision 2139.

> Second, but maybe more fundamental, it occurs to me that since the
> JLS says that null is assignment compatible with all reference
> types, there might be an argument that soot.NullType _should_ be
> made a subtype of soot.RefType, in which case the existing code in
> AbstractThrowAnalysis would work.  No doubt there are all sorts
> of reasons why NullType should not be a subclass of RefType, but I
> want to give people who understand type theory the chance to
> tell me those reasons.

Well, the simple reason is that in Soot, it's not always the case
that if s is a subtype of t, then the Soot representation of s is
a subtype of the Soot representation of t. For example, int and long
are not subtypes of each other in Soot. In the case of null, it's a
subtype of all array and reference types, so if we wanted to do that,
we would have to make NullType a subtype of ArrayType. That would be
just weird.

Ondrej


More information about the Soot-list mailing list