diff options
Diffstat (limited to 'libjava/java')
-rw-r--r-- | libjava/java/lang/natClass.cc | 3 |
1 files changed, 2 insertions, 1 deletions
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; |