aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2002-02-07 02:27:10 +0000
committerTom Tromey <tromey@gcc.gnu.org>2002-02-07 02:27:10 +0000
commit383aa2ef4972a828f0be6f36ff7f3e1c742fb173 (patch)
tree6c48c98f3752277d3f96825e9e3cbe7f9a40595a
parentedd1967d0c957ab48836fe0cc0128d012c6b6c6c (diff)
downloadgcc-383aa2ef4972a828f0be6f36ff7f3e1c742fb173.zip
gcc-383aa2ef4972a828f0be6f36ff7f3e1c742fb173.tar.gz
gcc-383aa2ef4972a828f0be6f36ff7f3e1c742fb173.tar.bz2
verify.cc (require_array_type): If argument is a null array of references, return null as the element type.
* verify.cc (require_array_type): If argument is a null array of references, return null as the element type. From-SVN: r49561
-rw-r--r--libjava/ChangeLog5
-rw-r--r--libjava/verify.cc6
2 files changed, 9 insertions, 2 deletions
diff --git a/libjava/ChangeLog b/libjava/ChangeLog
index 3a47cc0..bbf6942 100644
--- a/libjava/ChangeLog
+++ b/libjava/ChangeLog
@@ -1,3 +1,8 @@
+2002-02-06 Tom Tromey <tromey@redhat.com>
+
+ * verify.cc (require_array_type): If argument is a null array of
+ references, return null as the element type.
+
2002-02-06 Mark Wielaard <mark@klomp.org>
* verify.cc (verify_instructions_0) [op_dup2]: Actually push the
diff --git a/libjava/verify.cc b/libjava/verify.cc
index 8d235e7..562cfaf 100644
--- a/libjava/verify.cc
+++ b/libjava/verify.cc
@@ -1166,9 +1166,11 @@ 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.
+ // An odd case. Here we just pretend that everything went ok. If
+ // the requested element type is some kind of reference, return
+ // the null type instead.
if (array.isnull ())
- return element;
+ return element.isreference () ? type (null_type) : element;
if (! array.isarray ())
verify_fail ("array required");