Skip to content

Commit 6def7ef

Browse files
eduardo-vpEduardo VelardeMichalStrehovsky
authored
Fix RhpThrowImpl on ARM32 (#125253)
In RhpThrowImpl, before calling INLINE_GETTHREAD we were saving the caller-saved register r0 but we should save r2 as well since it contains the exception kind. Fixes #123979. --------- Co-authored-by: Eduardo Velarde <evelardepola@microsoft.com> Co-authored-by: Michal Strehovský <MichalStrehovsky@users.noreply.github.com>
1 parent 281d01c commit 6def7ef

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

src/coreclr/nativeaot/Runtime/arm/ExceptionHandling.S

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@ NESTED_ENTRY RhpThrowImpl, _TEXT, NoHandler
127127
str r4, [sp, #(rsp_offsetof_Context + OFFSETOF__PAL_LIMITED_CONTEXT__SP)]
128128

129129
mov r4, r0 // Save exception object
130+
mov r5, r2 // Save ExKind
130131
// r0 = GetThread()
131132
INLINE_GETTHREAD
132133

@@ -143,6 +144,7 @@ NESTED_ENTRY RhpThrowImpl, _TEXT, NoHandler
143144
ldr r3, [r0, #OFFSETOF__Thread__m_ppvHijackedReturnAddressLocation]
144145

145146
// r4: exception object
147+
// r5: ExKind
146148
// r1: hijacked return address
147149
// r0: pThread
148150
// r3: hijacked return address location
@@ -180,7 +182,7 @@ LOCAL_LABEL(NotHiJacked):
180182
str r3, [r1, #OFFSETOF__ExInfo__m_exception] // init the exception object to null
181183
mov r3, #1
182184
strb r3, [r1, #OFFSETOF__ExInfo__m_passNumber] // init to the first pass
183-
strb r2, [r1, #OFFSETOF__ExInfo__m_kind] // ExKind (from r2)
185+
strb r5, [r1, #OFFSETOF__ExInfo__m_kind] // ExKind
184186
mov r3, #0xFFFFFFFF
185187
str r3, [r1, #OFFSETOF__ExInfo__m_idxCurClause]
186188

src/libraries/System.Diagnostics.StackTrace/tests/StackTraceTests.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -631,7 +631,6 @@ public static IEnumerable<object[]> Ctor_Async_TestData()
631631
yield return new object[] { () => V2Methods.Bux(), MethodExceptionStrings["Bux"] };
632632
}
633633

634-
[ActiveIssue("https://github.com/dotnet/runtime/issues/123979", typeof(PlatformDetection), nameof(PlatformDetection.IsArmProcess))]
635634
[ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsRuntimeAsyncSupported))]
636635
[MemberData(nameof(Ctor_Async_TestData))]
637636
[MethodImpl(MethodImplOptions.NoOptimization | MethodImplOptions.NoInlining)]

0 commit comments

Comments
 (0)