summaryrefslogtreecommitdiff
path: root/src/vm/arm64/asmhelpers.asm
diff options
context:
space:
mode:
authorKyungwoo Lee <kyulee@microsoft.com>2016-04-12 09:11:53 -0700
committerKyungwoo Lee <kyulee@microsoft.com>2016-04-12 09:12:15 -0700
commit63554209e89d38785f2a1241939c490370e3efed (patch)
tree6dfce29fc6277e813385aa8cb34b8ed58ffe083d /src/vm/arm64/asmhelpers.asm
parentff26d6801b3ce0dec5918a5ad0d3ab90f9656e28 (diff)
downloadcoreclr-63554209e89d38785f2a1241939c490370e3efed.tar.gz
coreclr-63554209e89d38785f2a1241939c490370e3efed.tar.bz2
coreclr-63554209e89d38785f2a1241939c490370e3efed.zip
ARM64: Fix for recording SP for handler.
Fixes https://github.com/dotnet/coreclr/issues/3701. When GC occurs in a catch handler, we compare the current frame with the one saved before the funclet was invoked. The recorded SP address was wrong (offset by 16 byte), which caused FindParentStackFrameForStackWalk to null frame. So, we ended up with assert on `ExceptionTracker::HasFrameBeenUnwoundByAnyActiveException(&m_crawl)`. The issue was assembly helper, CallEHFunclet records FP instead of SP while SP is adjusted in prolog.
Diffstat (limited to 'src/vm/arm64/asmhelpers.asm')
-rw-r--r--src/vm/arm64/asmhelpers.asm3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/vm/arm64/asmhelpers.asm b/src/vm/arm64/asmhelpers.asm
index a12a484d6a..55df26aa74 100644
--- a/src/vm/arm64/asmhelpers.asm
+++ b/src/vm/arm64/asmhelpers.asm
@@ -972,7 +972,8 @@ UM2MThunk_WrapperHelper_RegArgumentsSetup
; X2 = address of X19 register in CONTEXT record; used to restore the non-volatile registers of CrawlFrame
; X3 = address of the location where the SP of funclet's caller (i.e. this helper) should be saved.
;
- ; Save the SP of this function
+ ; Save the SP of this function. We cannot store SP directly.
+ mov fp, sp
str fp, [x3]
ldr fp, [x2, #80] ; offset of fp in CONTEXT relative to X19