This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
Re: java/6754: Casting to gnu.gcj.RawData causes SEGV
- From: Tom Tromey <tromey at redhat dot com>
- To: Bryce McKinlay <bryce at waitaki dot otago dot ac dot nz>
- Cc: Adam Megacz <gcj at lists dot megacz dot com>, java at gcc dot gnu dot org
- Date: 31 May 2002 16:51:32 -0600
- Subject: Re: java/6754: Casting to gnu.gcj.RawData causes SEGV
- References: <86wutyb951.fsf@megacz.com> <3CE9B00A.8040808@waitaki.otago.ac.nz>
- Reply-to: tromey at redhat dot com
>>>>> "Bryce" == Bryce McKinlay <bryce@waitaki.otago.ac.nz> writes:
>> public static RawData bar(Object o) {
>> return (RawData)o;
>> }
Bryce> This isn't a bug. It isn't really safe to do anything with
Bryce> non-Java objects in Java code, you certainly can't cast one.
We should probably check for this case in the compiler and reject it.
We should also reject `instanceof RawData'.
That would be more friendly for the user.
The problems with extensions... :-(
Tom