Skip to content

Commit

Permalink
[NativeAOT] Fix stack trace iteration over exceptions (#105877)
Browse files Browse the repository at this point in the history
* [NativeAOT] Fix stack trace iteration over exceptions

* Remove exclusion for b08944b

* Remove code that was trying to counter-balance ApplyReturnAddressAdjustment

* Update src/coreclr/nativeaot/Runtime/StackFrameIterator.cpp

* Simplify comment

---------

Co-authored-by: Jan Kotas <[email protected]>
  • Loading branch information
filipnavara and jkotas authored Aug 15, 2024
1 parent 87ce5eb commit 6c400b2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
9 changes: 3 additions & 6 deletions src/coreclr/nativeaot/Runtime/StackFrameIterator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -811,11 +811,6 @@ PTR_VOID StackFrameIterator::HandleExCollide(PTR_ExInfo pExInfo)
// Sync our 'current' ExInfo with the updated state (we may have skipped other dispatches)
ResetNextExInfoForSP(m_RegDisplay.GetSP());

// In case m_ControlPC is pre-adjusted, counteract here, since the caller of this routine
// will apply the adjustment again once we return. If the m_ControlPC is not pre-adjusted,
// this is simply an no-op.
m_ControlPC = m_OriginalControlPC;

m_dwFlags = curFlags;

// The iterator has been moved to the "owner frame" (either a parent funclet or the main
Expand Down Expand Up @@ -1830,7 +1825,9 @@ 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. In that case the m_ControlPC was copied from
// another stack frame iterator and it already has a correct value.
if ((m_dwFlags & (ApplyReturnAddressAdjustment | ExCollide)) == ApplyReturnAddressAdjustment)
{
m_ControlPC = AdjustReturnAddressBackward(m_ControlPC);
}
Expand Down
3 changes: 0 additions & 3 deletions src/tests/issues.targets
Original file line number Diff line number Diff line change
Expand Up @@ -1212,9 +1212,6 @@
<ExcludeList Include="$(XunitTestBinBase)/JIT/Regression/CLR-x86-JIT/V1.1-M1-Beta1/b143840/b143840/**">
<Issue>https://github.com/dotnet/runtime/issues/101363</Issue>
</ExcludeList>
<ExcludeList Include="$(XunitTestBinBase)/JIT/Regression/CLR-x86-JIT/V1-M10/b08944/b08944b/**">
<Issue>https://github.com/dotnet/runtime/issues/101364</Issue>
</ExcludeList>
</ItemGroup>

<!-- run.proj finds all the *.cmd/*.sh scripts in a test folder and creates corresponding test methods.
Expand Down

0 comments on commit 6c400b2

Please sign in to comment.