diff options
Diffstat (limited to 'libjava/java/lang/natClassLoader.cc')
-rw-r--r-- | libjava/java/lang/natClassLoader.cc | 29 |
1 files changed, 16 insertions, 13 deletions
diff --git a/libjava/java/lang/natClassLoader.cc b/libjava/java/lang/natClassLoader.cc index 00292f93dad..b8d87c6062b 100644 --- a/libjava/java/lang/natClassLoader.cc +++ b/libjava/java/lang/natClassLoader.cc @@ -252,27 +252,30 @@ _Jv_FindClass (_Jv_Utf8Const *name, java::lang::ClassLoader *loader) // Not even a bootstrap loader, try the built-in cache. klass = _Jv_FindClassInCache (name); - bool found = false; - for (int i = 0; i < bootstrap_index; ++i) + if (klass) { - if (bootstrap_class_list[i] == klass) + bool found = false; + for (int i = 0; i < bootstrap_index; ++i) { - found = true; - break; + if (bootstrap_class_list[i] == klass) + { + found = true; + break; + } + } + if (! found) + { + if (bootstrap_index == BOOTSTRAP_CLASS_LIST_SIZE) + abort (); + bootstrap_class_list[bootstrap_index++] = klass; } - } - if (! found) - { - if (bootstrap_index == BOOTSTRAP_CLASS_LIST_SIZE) - abort (); - bootstrap_class_list[bootstrap_index++] = klass; } } } else { - // we need classes to be in the hash while - // we're loading, so that they can refer to themselves. + // We need classes to be in the hash while we're loading, so + // that they can refer to themselves. _Jv_Linker::wait_for_state (klass, JV_STATE_LOADED); } |