This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
Patch: FYI: PR 7709
- From: Tom Tromey <tromey at redhat dot com>
- To: Java Patch List <java-patches at gcc dot gnu dot org>
- Date: 25 Sep 2002 14:58:01 -0600
- Subject: Patch: FYI: PR 7709
- Reply-to: tromey at redhat dot com
I'm checking this in.
This is the suggested fix from PR 7709. I think it is correct; it
makes sense to fail if `the_method == 0' before using this value to
try to determine the vtable index.
Tom
Index: ChangeLog
from Jesse Rosenstock <jmr@ugcs.caltech.edu>
* resolve.cc (_Jv_ResolvePoolEntry) [end_of_method_search]: Check
to see if `the_method == 0' before looking up vtable index.
Fixes PR libgcj/7709.
Index: resolve.cc
===================================================================
RCS file: /cvs/gcc/gcc/libjava/resolve.cc,v
retrieving revision 1.31
diff -u -r1.31 resolve.cc
--- resolve.cc 25 Sep 2002 20:57:03 -0000 1.31
+++ resolve.cc 25 Sep 2002 21:00:13 -0000
@@ -303,16 +303,6 @@
// with either loader should produce the same result,
// i.e., exactly the same jclass object. JVMS 5.4.3.3
- if (pool->tags[index] == JV_CONSTANT_InterfaceMethodref)
- vtable_index = -1;
- else
- vtable_index = _Jv_DetermineVTableIndex
- (found_class, method_name, method_signature);
-
- if (vtable_index == METHOD_NOT_THERE)
- throw_incompatible_class_change_error
- (JvNewStringLatin1 ("method not found"));
-
if (the_method == 0)
{
java::lang::StringBuffer *sb = new java::lang::StringBuffer();
@@ -324,6 +314,16 @@
throw new java::lang::NoSuchMethodError (sb->toString());
}
+ if (pool->tags[index] == JV_CONSTANT_InterfaceMethodref)
+ vtable_index = -1;
+ else
+ vtable_index = _Jv_DetermineVTableIndex (found_class, method_name,
+ method_signature);
+
+ if (vtable_index == METHOD_NOT_THERE)
+ throw_incompatible_class_change_error
+ (JvNewStringLatin1 ("method not found"));
+
pool->data[index].rmethod =
_Jv_BuildResolvedMethod(the_method,
found_class,