Patch: _Jv_FindClassFromSignature

Tom Tromey tromey@redhat.com
Fri Mar 23 11:10:00 GMT 2001


>>>>> "Jeff" == Jeff Sturm <jsturm@one-point.com> writes:

Jeff> 	* prims.cc (_Jv_FindClassFromSignature): Check return of
Jeff> 	recursive call.  Do not abort on invalid signature; return NULL
Jeff> 	instead.

This is ok.  I'm checking in a slightly different patch, appended.

I also checked in a Mauve regression test for this.

I understand Bryce has some other Class.forName fixes.  I'm not sure
exactly what they fix though.

Tom

Index: prims.cc
===================================================================
RCS file: /cvs/gcc/gcc/libjava/prims.cc,v
retrieving revision 1.46.4.1
diff -u -r1.46.4.1 prims.cc
--- prims.cc	2001/03/12 07:33:57	1.46.4.1
+++ prims.cc	2001/03/23 19:08:42
@@ -559,10 +559,14 @@
 
       }
     case '[':
-      return _Jv_GetArrayClass (_Jv_FindClassFromSignature (&sig[1], loader),
-				loader);
+      {
+	jclass klass = _Jv_FindClassFromSignature (&sig[1], loader);
+	if (! klass)
+	  return NULL;
+	return _Jv_GetArrayClass (klass, loader);
+      }
     }
-  JvFail ("couldn't understand class signature");
+
   return NULL;			// Placate compiler.
 }
 



More information about the Java-patches mailing list