diff options
author | Jesse Rosenstock <jmr@ugcs.caltech.edu> | 2002-09-25 21:02:32 +0000 |
---|---|---|
committer | Tom Tromey <tromey@gcc.gnu.org> | 2002-09-25 21:02:32 +0000 |
commit | 8848a766bc1ec6b38f278ecef52e2d8bd5a946da (patch) | |
tree | c64d6359e2056eac9f442892ab9193a1452fcc1e /libjava | |
parent | 169f75f3846b0b292f5a7a6b4fddc1023c663ec6 (diff) | |
download | gcc-8848a766bc1ec6b38f278ecef52e2d8bd5a946da.zip gcc-8848a766bc1ec6b38f278ecef52e2d8bd5a946da.tar.gz gcc-8848a766bc1ec6b38f278ecef52e2d8bd5a946da.tar.bz2 |
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
Diffstat (limited to 'libjava')
-rw-r--r-- | libjava/ChangeLog | 7 | ||||
-rw-r--r-- | libjava/resolve.cc | 20 |
2 files changed, 17 insertions, 10 deletions
diff --git a/libjava/ChangeLog b/libjava/ChangeLog index b97f9d5..dc94efb 100644 --- a/libjava/ChangeLog +++ b/libjava/ChangeLog @@ -1,3 +1,9 @@ +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> * java/lang/natClassLoader.cc: @@ -5,6 +11,7 @@ * resolve.cc: Include NoClassDefFoundError.h, not ClassNotFoundException.h. (_Jv_ResolvePoolEntry): Throw NoClassDefFoundError, per spec. + * defineclass.cc: Don't include ClassNotFoundException.h. * resolve.cc: Include StringBuffer. diff --git a/libjava/resolve.cc b/libjava/resolve.cc index af1f7c6..f3b98a7 100644 --- a/libjava/resolve.cc +++ b/libjava/resolve.cc @@ -303,16 +303,6 @@ _Jv_ResolvePoolEntry (jclass klass, int index) // 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 @@ _Jv_ResolvePoolEntry (jclass klass, int index) 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, |