mirror of
https://github.com/corda/corda.git
synced 2025-01-06 05:04:20 +00:00
fix stack unwinding for new calling convention (2nd try)
This commit is contained in:
parent
03653d2dd8
commit
299699f1ff
@ -1314,36 +1314,37 @@ findUnwindTarget(MyThread* t, void** targetIp, void** targetBase,
|
|||||||
|
|
||||||
void* handler = findExceptionHandler(t, method, ip);
|
void* handler = findExceptionHandler(t, method, ip);
|
||||||
|
|
||||||
t->arch->nextFrame(&stack, &base);
|
|
||||||
|
|
||||||
void* canonicalStack = stackForFrame(t, stack, method);
|
|
||||||
|
|
||||||
if (handler) {
|
if (handler) {
|
||||||
void** sp = static_cast<void**>(canonicalStack)
|
*targetIp = handler;
|
||||||
|
*targetBase = base;
|
||||||
|
|
||||||
|
t->arch->nextFrame(&stack, &base);
|
||||||
|
|
||||||
|
void** sp = static_cast<void**>(stackForFrame(t, stack, method))
|
||||||
+ t->arch->frameReturnAddressSize();
|
+ t->arch->frameReturnAddressSize();
|
||||||
|
|
||||||
|
*targetStack = sp;
|
||||||
|
|
||||||
sp[localOffset(t, localSize(t, method), method) / BytesPerWord]
|
sp[localOffset(t, localSize(t, method), method) / BytesPerWord]
|
||||||
= t->exception;
|
= t->exception;
|
||||||
|
|
||||||
t->exception = 0;
|
t->exception = 0;
|
||||||
|
|
||||||
*targetIp = handler;
|
|
||||||
*targetBase = base;
|
|
||||||
*targetStack = sp;
|
|
||||||
} else {
|
} else {
|
||||||
|
t->arch->nextFrame(&stack, &base);
|
||||||
|
ip = t->arch->frameIp(stack);
|
||||||
|
|
||||||
if (methodFlags(t, method) & ACC_SYNCHRONIZED) {
|
if (methodFlags(t, method) & ACC_SYNCHRONIZED) {
|
||||||
object lock;
|
object lock;
|
||||||
if (methodFlags(t, method) & ACC_STATIC) {
|
if (methodFlags(t, method) & ACC_STATIC) {
|
||||||
lock = methodClass(t, method);
|
lock = methodClass(t, method);
|
||||||
} else {
|
} else {
|
||||||
lock = *localObject
|
lock = *localObject
|
||||||
(t, canonicalStack, method, savedTargetIndex(t, method));
|
(t, stackForFrame(t, stack, method), method,
|
||||||
|
savedTargetIndex(t, method));
|
||||||
}
|
}
|
||||||
|
|
||||||
release(t, lock);
|
release(t, lock);
|
||||||
}
|
}
|
||||||
|
|
||||||
ip = t->arch->frameIp(stack);
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
*targetIp = ip;
|
*targetIp = ip;
|
||||||
@ -4457,15 +4458,15 @@ finish(MyThread* t, Allocator* allocator, Context* context)
|
|||||||
(&byteArrayBody(t, methodSpec(t, context->method), 0)));
|
(&byteArrayBody(t, methodSpec(t, context->method), 0)));
|
||||||
|
|
||||||
// for debugging:
|
// for debugging:
|
||||||
if (//false and
|
if (false and
|
||||||
strcmp
|
strcmp
|
||||||
(reinterpret_cast<const char*>
|
(reinterpret_cast<const char*>
|
||||||
(&byteArrayBody(t, className(t, methodClass(t, context->method)), 0)),
|
(&byteArrayBody(t, className(t, methodClass(t, context->method)), 0)),
|
||||||
"java/lang/Long") == 0 and
|
"java/lang/Throwable") == 0 and
|
||||||
strcmp
|
strcmp
|
||||||
(reinterpret_cast<const char*>
|
(reinterpret_cast<const char*>
|
||||||
(&byteArrayBody(t, methodName(t, context->method), 0)),
|
(&byteArrayBody(t, methodName(t, context->method), 0)),
|
||||||
"toString") == 0)
|
"printStackTrace") == 0)
|
||||||
{
|
{
|
||||||
trap();
|
trap();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user