From 3ec4ef9bd2042ff7b4005644cfce1ffd439fa771 Mon Sep 17 00:00:00 2001 From: Joel Dice Date: Wed, 13 Jul 2011 18:06:02 -0600 Subject: [PATCH] fix stack unwinding from native methods for tails=true build We can't clear t->trace->targetMethod until after findUnwindTarget has been called or we'll lose track of where we are on the stack. --- src/compile.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/compile.cpp b/src/compile.cpp index c29f403e61..046f3ad267 100644 --- a/src/compile.cpp +++ b/src/compile.cpp @@ -2190,6 +2190,9 @@ unwind(MyThread* t) object continuation; findUnwindTarget(t, &ip, &frame, &stack, &continuation); + t->trace->targetMethod = 0; + t->trace->nativeMethod = 0; + transition(t, ip, stack, continuation, t->trace); vmJump(ip, frame, stack, t, 0, 0); @@ -7328,11 +7331,6 @@ invokeNative(MyThread* t) uint64_t result = 0; t->trace->targetMethod = t->trace->nativeMethod; - - THREAD_RESOURCE0(t, { - static_cast(t)->trace->targetMethod = 0; - static_cast(t)->trace->nativeMethod = 0; - }); t->m->classpath->resolveNative(t, t->trace->nativeMethod); @@ -7355,6 +7353,9 @@ invokeNative(MyThread* t) transition(t, getIp(t), stack, t->continuation, t->trace); + t->trace->targetMethod = 0; + t->trace->nativeMethod = 0; + return result; }