diff options
-rw-r--r-- | libjava/ChangeLog | 6 | ||||
-rw-r--r-- | libjava/java/lang/natClass.cc | 3 |
2 files changed, 8 insertions, 1 deletions
diff --git a/libjava/ChangeLog b/libjava/ChangeLog index 41b7a10d940..207248ff871 100644 --- a/libjava/ChangeLog +++ b/libjava/ChangeLog @@ -1,3 +1,9 @@ +2008-01-04 Andrew Haley <aph@redhat.com> + + PR libgcj/34444 + * java/lang/natClass.cc (Class::getEnclosingClass): Call + getDeclaringClass(). + 2007-12-22 David Daney <ddaney@avtrex.com> * scripts/makemake.tcl (emit_bc_rule): Use $(LIBGCJ_BC_FLAGS) diff --git a/libjava/java/lang/natClass.cc b/libjava/java/lang/natClass.cc index 47d7739c715..5b141605f92 100644 --- a/libjava/java/lang/natClass.cc +++ b/libjava/java/lang/natClass.cc @@ -1043,7 +1043,8 @@ java::lang::Class::getEnclosingClass() _Jv_word indexes; indexes.i = getEnclosingMethodData(); if (indexes.i == 0) - return NULL; + // No enclosing method, but perhaps a member or anonymous class + return getDeclaringClass(); _Jv_ushort class_index, method_index; _Jv_loadIndexes (&indexes, class_index, method_index); return _Jv_Linker::resolve_pool_entry (this, class_index).clazz; |