-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix passing too small args for PUTARG_STK on macOS arm64 ABI (#68113)
Backport of #68108
- Loading branch information
1 parent
3199160
commit 39dbeee
Showing
3 changed files
with
52 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
src/tests/JIT/Regression/JitBlue/Runtime_66720/Runtime_66720.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
|
||
using System.Runtime.CompilerServices; | ||
|
||
public class Runtime_66720 | ||
{ | ||
public static int Main() | ||
{ | ||
return Test(0); | ||
} | ||
|
||
[MethodImpl(MethodImplOptions.NoInlining)] | ||
private static int Test(in short zero) | ||
{ | ||
// Fill arg stack slot with all ones | ||
LastArg(0, 0, 0, 0, 0, 0, 0, 0, -1); | ||
// Bug was that the last arg passed here would write only 16 bits | ||
// instead of 32 bits | ||
int last = LastArg(0, 0, 0, 0, 0, 0, 0, 0, zero); | ||
return last == 0 ? 100 : -1; | ||
} | ||
|
||
[MethodImpl(MethodImplOptions.NoInlining)] | ||
private static int LastArg(int a, int b, int c, int d, int e, int f, int g, int h, int i) | ||
{ | ||
return i; | ||
} | ||
} |
9 changes: 9 additions & 0 deletions
9
src/tests/JIT/Regression/JitBlue/Runtime_66720/Runtime_66720.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
<PropertyGroup> | ||
<OutputType>Exe</OutputType> | ||
<Optimize>True</Optimize> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<Compile Include="$(MSBuildProjectName).cs" /> | ||
</ItemGroup> | ||
</Project> |