if we can't resolve a bootstrap class in isAssignableFrom(), we swallow the exception and return false

This commit is contained in:
Joel Dice 2007-11-05 09:08:08 -07:00
parent fe0708c09a
commit f1bc2be9f9
3 changed files with 9 additions and 5 deletions

View File

@ -1082,9 +1082,8 @@ interpret(Thread* t)
(t, className(t, objectClass(t, peekObject(t, sp - 1))), 0),
&byteArrayBody(t, className(t, class_), 0));
exception = makeClassCastException(t, message);
goto throw_;
}
if (UNLIKELY(exception)) goto throw_;
}
} goto loop;
@ -1785,8 +1784,6 @@ interpret(Thread* t)
} else {
pushInt(t, 0);
}
if (UNLIKELY(exception)) goto throw_;
} else {
popObject(t);
pushInt(t, 0);

View File

@ -2132,7 +2132,10 @@ isAssignableFrom(Thread* t, object a, object b)
if (classFlags(t, a) & ACC_INTERFACE) {
if (classVmFlags(t, b) & BootstrapFlag) {
resolveClass(t, className(t, b));
if (UNLIKELY(t->exception)) return false;
if (UNLIKELY(t->exception)) {
t->exception = 0;
return false;
}
}
for (; b; b = classSuper(t, b)) {

View File

@ -1309,6 +1309,10 @@ parseJavaClass(Object* type, Stream* s, Object* declarations)
unsigned interfaceCount = s->read2();
s->skip(interfaceCount * 2);
// for (unsigned i = 0; i < interfaceCount; ++i) {
// const char* name = reinterpret_cast<const char*>
// (pool[pool[s->read2() - 1] - 1]);
// }
unsigned fieldCount = s->read2();
for (unsigned i = 0; i < fieldCount; ++i) {