mark system classloader initialized when using GNU Classpath to avoid security exceptions; only look for field in interfaces after looking in class and superclasses

This commit is contained in:
Joel Dice 2009-12-24 17:57:07 -07:00
parent 40c65f66bf
commit 805d1d13d8

View File

@ -1910,6 +1910,10 @@ boot(Thread* t)
(t, m->types, Machine::SystemClassLoaderType); (t, m->types, Machine::SystemClassLoaderType);
set(t, m->loader, 0, loaderClass); set(t, m->loader, 0, loaderClass);
#ifdef AVIAN_GNU
classLoaderInitialized(t, m->loader) = true;
#endif
object objectClass = arrayBody(t, m->types, Machine::JobjectType); object objectClass = arrayBody(t, m->types, Machine::JobjectType);
object classClass = arrayBody(t, m->types, Machine::ClassType); object classClass = arrayBody(t, m->types, Machine::ClassType);
@ -3355,13 +3359,13 @@ findInHierarchy(Thread* t, object class_, object name, object spec,
} }
if (o == 0) { if (o == 0) {
if (find == findFieldInClass) {
o = findInInterfaces(t, originalClass, name, spec, find);
}
for (; o == 0 and class_; class_ = classSuper(t, class_)) { for (; o == 0 and class_; class_ = classSuper(t, class_)) {
o = find(t, class_, name, spec); o = find(t, class_, name, spec);
} }
if (o == 0 and find == findFieldInClass) {
o = findInInterfaces(t, originalClass, name, spec, find);
}
} }
if (o == 0) { if (o == 0) {