diff options
author | tromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4> | 2002-02-06 21:53:59 +0000 |
---|---|---|
committer | tromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4> | 2002-02-06 21:53:59 +0000 |
commit | a9f04acb8d52fdb323bbfc9e53f34652c4987af7 (patch) | |
tree | 3806bc869225f6b52ce0fdf978c60ab87dbb1a5b | |
parent | 1e572fcea99db21083098373a032ae52f5e54b28 (diff) | |
download | gcc-a9f04acb8d52fdb323bbfc9e53f34652c4987af7.tar.gz |
* verify.cc (type::isnull): New method.
(require_array_type): Handle case where array is null.
(verify_instructions_0) [op_arraylength]: Likewise.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@49555 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r-- | libjava/ChangeLog | 6 | ||||
-rw-r--r-- | libjava/verify.cc | 11 |
2 files changed, 16 insertions, 1 deletions
diff --git a/libjava/ChangeLog b/libjava/ChangeLog index ef14272f479..4823eccaa2b 100644 --- a/libjava/ChangeLog +++ b/libjava/ChangeLog @@ -1,3 +1,9 @@ +2002-02-06 Tom Tromey <tromey@redhat.com> + + * verify.cc (type::isnull): New method. + (require_array_type): Handle case where array is null. + (verify_instructions_0) [op_arraylength]: Likewise. + 2002-02-05 Bryce McKinlay <bryce@waitaki.otago.ac.nz> * configure.in: Set up PLATFORMOBJS not PLATFORM_SPECIFIC_SOURCES. diff --git a/libjava/verify.cc b/libjava/verify.cc index c9cfb885fdf..46cee1533ce 100644 --- a/libjava/verify.cc +++ b/libjava/verify.cc @@ -522,6 +522,11 @@ private: return false; } + bool isnull () const + { + return key == null_type; + } + bool isinterface (_Jv_BytecodeVerifier *verifier) { resolve (verifier); @@ -1161,6 +1166,10 @@ private: // compatible with type ELEMENT. Returns the actual element type. type require_array_type (type array, type element) { + // An odd case. Here we just pretend that everything went ok. + if (array.isnull ()) + return element; + if (! array.isarray ()) verify_fail ("array required"); @@ -2796,7 +2805,7 @@ private: case op_arraylength: { type t = pop_type (reference_type); - if (! t.isarray ()) + if (! t.isarray () && ! t.isnull ()) verify_fail ("array type expected"); push_type (int_type); } |