Commit 8848a766 by Jesse Rosenstock Committed by Tom Tromey

re PR libgcj/7709 (NullPointerException in _Jv_ResolvePoolEntry)

2002-09-25  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.

From-SVN: r57517
parent 169f75f3
2002-09-25 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.
2002-09-25 Tom Tromey <tromey@redhat.com> 2002-09-25 Tom Tromey <tromey@redhat.com>
* java/lang/natClassLoader.cc: * java/lang/natClassLoader.cc:
...@@ -5,6 +11,7 @@ ...@@ -5,6 +11,7 @@
* resolve.cc: Include NoClassDefFoundError.h, not * resolve.cc: Include NoClassDefFoundError.h, not
ClassNotFoundException.h. ClassNotFoundException.h.
(_Jv_ResolvePoolEntry): Throw NoClassDefFoundError, per spec. (_Jv_ResolvePoolEntry): Throw NoClassDefFoundError, per spec.
* defineclass.cc: Don't include ClassNotFoundException.h. * defineclass.cc: Don't include ClassNotFoundException.h.
* resolve.cc: Include StringBuffer. * resolve.cc: Include StringBuffer.
......
...@@ -303,16 +303,6 @@ _Jv_ResolvePoolEntry (jclass klass, int index) ...@@ -303,16 +303,6 @@ _Jv_ResolvePoolEntry (jclass klass, int index)
// with either loader should produce the same result, // with either loader should produce the same result,
// i.e., exactly the same jclass object. JVMS 5.4.3.3 // 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) if (the_method == 0)
{ {
java::lang::StringBuffer *sb = new java::lang::StringBuffer(); java::lang::StringBuffer *sb = new java::lang::StringBuffer();
...@@ -324,6 +314,16 @@ _Jv_ResolvePoolEntry (jclass klass, int index) ...@@ -324,6 +314,16 @@ _Jv_ResolvePoolEntry (jclass klass, int index)
throw new java::lang::NoSuchMethodError (sb->toString()); 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 = pool->data[index].rmethod =
_Jv_BuildResolvedMethod(the_method, _Jv_BuildResolvedMethod(the_method,
found_class, found_class,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment