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: PR 7709


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,


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