Apple Silicon fix remote unwinding (#49974)
authorSteve MacLean <Steve.MacLean@microsoft.com>
Mon, 22 Mar 2021 13:27:14 +0000 (09:27 -0400)
committerGitHub <noreply@github.com>
Mon, 22 Mar 2021 13:27:14 +0000 (09:27 -0400)
src/coreclr/pal/src/exception/remote-unwind.cpp

index 5bdf10e..2d00f09 100644 (file)
@@ -1451,15 +1451,16 @@ StepWithCompactEncodingArm64(const libunwindInfo* info, compact_unwind_encoding_
 
     context->Sp = callerSp;
 
-    // return address is stored in Lr
-    context->Pc = context->Lr;
-
     unw_word_t addr = callerSp;
 
     if (hasFrame &&
         !ReadCompactEncodingRegisterPair(info, &addr, &context->Lr, &context->Fp)) {
             return false;
     }
+
+    // unwound return address is stored in Lr
+    context->Pc = context->Lr;
+
     if (compactEncoding & UNWIND_ARM64_FRAME_X19_X20_PAIR &&
         !ReadCompactEncodingRegisterPair(info, &addr, &context->X[19], &context->X[20])) {
             return false;