diff --git a/src/compile-arm.S b/src/compile-arm.S index 555c61476b..c61ebaff37 100644 --- a/src/compile-arm.S +++ b/src/compile-arm.S @@ -96,6 +96,14 @@ GLOBAL(vmInvoke_returnAddress): // restore frame ldr sp, [sp] + + // clear MyThread::stack to avoid confusing another thread calling + // java.lang.Thread.getStackTrace on this one. See + // MyProcess::getStackTrace in compile.cpp for details on how we get + // a reliable stack trace from a thread that might be interrupted at + // any point in its execution. + mov r5,#0 + str r5,[r8,#THREAD_STACK] .globl GLOBAL(vmInvoke_safeStack) GLOBAL(vmInvoke_safeStack):