From b5e1c953996ac40e33973a6a490c545d51338b26 Mon Sep 17 00:00:00 2001 From: Filip Navara Date: Fri, 2 Aug 2024 16:08:13 +0200 Subject: [PATCH 1/5] [NativeAOT] Fix stack trace iteration over exceptions --- src/coreclr/nativeaot/Runtime/StackFrameIterator.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/coreclr/nativeaot/Runtime/StackFrameIterator.cpp b/src/coreclr/nativeaot/Runtime/StackFrameIterator.cpp index 7ffaf3cab3afe..e48a8c6a97f3e 100644 --- a/src/coreclr/nativeaot/Runtime/StackFrameIterator.cpp +++ b/src/coreclr/nativeaot/Runtime/StackFrameIterator.cpp @@ -1830,7 +1830,10 @@ void StackFrameIterator::PrepareToYieldFrame() ASSERT(m_pInstance->IsManaged(m_ControlPC) || ((m_dwFlags & SkipNativeFrames) == 0 && (m_dwFlags & UnwoundReversePInvoke) != 0)); - if (m_dwFlags & ApplyReturnAddressAdjustment) + // Do not adjust the PC if ExCollide is set since in that case it's set to the + // beginning of the instruction from ExInfo and adjusting it would cause to move + // to the previous instruction. + if ((m_dwFlags & (ApplyReturnAddressAdjustment | ExCollide)) == ApplyReturnAddressAdjustment) { m_ControlPC = AdjustReturnAddressBackward(m_ControlPC); } From daba428a36cf0145749c0454d97c260dd3bd7fe3 Mon Sep 17 00:00:00 2001 From: Filip Navara Date: Fri, 2 Aug 2024 16:08:47 +0200 Subject: [PATCH 2/5] Remove exclusion for b08944b --- src/tests/issues.targets | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/tests/issues.targets b/src/tests/issues.targets index a1da972936558..4e87627859d2d 100644 --- a/src/tests/issues.targets +++ b/src/tests/issues.targets @@ -1215,9 +1215,6 @@ https://github.com/dotnet/runtime/issues/101363 - - https://github.com/dotnet/runtime/issues/101364 -