This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java 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]

Patch: FYI: another verifier fix


I'm checking this in.

This is a refinement of an earlier patch and fixes another bug
discovered by Mark Wielaard.

Tom

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.


Index: verify.cc
===================================================================
RCS file: /cvs/gcc/gcc/libjava/verify.cc,v
retrieving revision 1.34
diff -u -r1.34 verify.cc
--- verify.cc 2002/02/07 01:11:32 1.34
+++ verify.cc 2002/02/07 01:31:44
@@ -1166,9 +1166,11 @@
   // 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");


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