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]

Re: Patch: _Jv_FindClassFromSignature


>>>>> "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.
 }
 


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