This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: java/8025: ICE when bytecode does array access on null


http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=8025

Andrew Haley pointed out that arraylength also suffers from the same fate - see this thread: http://gcc.gnu.org/ml/java/2002-09/msg00241.html

I also confirmed that the jikes compiler allows the following:
class Foo {
public static void main(String[] args) {
int i = ((Object[]) null).length;
((Object[]) null)[0] = null;
}
}

This compiled to:
Method void main(java.lang.String[])
0 aconst_null
1 arraylength
2 istore_1
3 aconst_null
4 iconst_0
5 aconst_null
6 aastore
7 return

And successfully verified with JDK 1.4.1. So it is possible to use null types directly, instead of storing them into a local variable first.



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]