This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
Re: Patch: _Jv_FindClassFromSignature
- To: Jeff Sturm <jsturm at one-point dot com>
- Subject: Re: Patch: _Jv_FindClassFromSignature
- From: Tom Tromey <tromey at redhat dot com>
- Date: 23 Mar 2001 12:19:46 -0700
- Cc: java-patches at gcc dot gnu dot org
- References: <Pine.LNX.4.10.10103230850200.21052-100000@mars.deadcafe.org>
- Reply-To: tromey at redhat dot com
>>>>> "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.
}