C++ and Java CNI: Check Java references

Tom Tromey tromey@redhat.com
Fri Apr 27 10:07:00 GMT 2001


>>>>> "Andrew" == Andrew Haley <aph@redhat.com> writes:

>> Mark Mitchell writes:
>> JavaPointer<Foo> f;
>> f-> bar();
>> You don't need to check `this' in `Foo::bar'; you'll have checked at
>> the call-site.

Andrew> Okay, I guess that's true as long as we enforce this same rule
Andrew> in the Java compiler: that is, whenever we call a method, even
Andrew> if that method can be resolved without going via a vtable, we
Andrew> check that the object is non-NULL. Problem solved.
FWIW we already do this check. Look for INVOKE_NONVIRTUAL in parse.y.
Offhand I don't know if we do this when compiling from bytecode, but I
assume we do.
Tom


More information about the Java mailing list

AltStyle によって変換されたページ (->オリジナル) /