mirror of
https://github.com/corda/corda.git
synced 2025-01-19 03:06:36 +00:00
set Thread::exception to null before creating ExceptionInInitializerError
If we don't do this, the VM will crash when it tries to create a stack trace for the error because makeObjectArray will return null immediately when it sees there is a pending exception.
This commit is contained in:
parent
74d2afd707
commit
5d5a18c482
@ -3436,8 +3436,10 @@ postInitClass(Thread* t, object c)
|
||||
ACQUIRE(t, t->m->classLock);
|
||||
|
||||
if (t->exception) {
|
||||
object exception = t->exception;
|
||||
t->exception = 0;
|
||||
t->exception = makeThrowable
|
||||
(t, Machine::ExceptionInInitializerErrorType, 0, 0, t->exception);
|
||||
(t, Machine::ExceptionInInitializerErrorType, 0, 0, exception);
|
||||
|
||||
classVmFlags(t, c) |= NeedInitFlag | InitErrorFlag;
|
||||
classVmFlags(t, c) &= ~InitFlag;
|
||||
@ -3882,6 +3884,7 @@ makeTrace(Thread* t, Processor::StackWalker* walker)
|
||||
virtual bool visit(Processor::StackWalker* walker) {
|
||||
if (trace == 0) {
|
||||
trace = makeObjectArray(t, walker->count());
|
||||
vm_assert(t, trace);
|
||||
}
|
||||
|
||||
object e = makeTraceElement(t, walker->method(), walker->ip());
|
||||
|
Loading…
Reference in New Issue
Block a user