mirror of
https://github.com/corda/corda.git
synced 2025-06-19 07:38:22 +00:00
fix ARM stack unwinding
We can't rely on the C++ compiler to save the return address in a known location on entry to each function we might call from Java (although GCC 4.5 seems to do so consistently, which is why I hadn't realized the unwinding code was relying on that assumption), so we must store it explicitly in MyThread::ip in each thunk. For PowerPC and x86, we continue saving it on the stack as always, since the calling convention guarantees its location relative to the stack pointer.
This commit is contained in:
@ -2126,7 +2126,11 @@ class MyAssembler: public Assembler {
|
||||
&handlerConstant);
|
||||
}
|
||||
|
||||
virtual void saveFrame(unsigned stackOffset) {
|
||||
virtual void saveFrame(unsigned stackOffset, unsigned ipOffset) {
|
||||
Register link(LinkRegister);
|
||||
Memory linkDst(ThreadRegister, ipOffset);
|
||||
moveRM(&c, BytesPerWord, &link, BytesPerWord, &linkDst);
|
||||
|
||||
Register stack(StackRegister);
|
||||
Memory stackDst(ThreadRegister, stackOffset);
|
||||
moveRM(&c, BytesPerWord, &stack, BytesPerWord, &stackDst);
|
||||
|
Reference in New Issue
Block a user