-
Notifications
You must be signed in to change notification settings - Fork 5.5k
[wasm] Fix JIT helper calls modeled with the wrong return arity #131383
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
d1d3737
[wasm][R2R] Model inline-unbox slow-path helper as value-returning on…
lewing d1c5be2
[wasm] Fix two more helper calls modeled with the wrong return arity
lewing d8dba2a
[wasm] Add regression test for the stack-allocated unbox type-test he…
lewing 0993520
[wasm] Rename HelperUnboxRetType to make the discard intent explicit
lewing fff0265
Trim comments
lewing 96a1e56
Model the inline unbox helper as TYP_BYREF on all targets
lewing d34c5d5
Model the discarded unbox helper as value-returning only on wasm
lewing 93b5bcd
Drop the gtUnusedValNode wrapper in fgMorphInit
lewing 99c4432
[wasm][R2R] Model inline-unbox slow-path helper as value-returning on…
lewing 31d63ea
[wasm] Fix two more helper calls modeled with the wrong return arity
lewing 648c6ef
[wasm] Add regression test for the stack-allocated unbox type-test he…
lewing f2fec2e
[wasm] Rename HelperUnboxRetType to make the discard intent explicit
lewing 4331eb3
Trim comments
lewing f2a71f6
Model the inline unbox helper as TYP_BYREF on all targets
lewing 60c1db7
Model the discarded unbox helper as value-returning only on wasm
lewing 94a3572
Drop the gtUnusedValNode wrapper in fgMorphInit
lewing ecdc3d1
Merge commit '93b5bcdb856c4dc16e668f6fdfdbd5995630c5d4' into lewing-i…
lewing 7b5982b
Merge branch 'main' into lewing-ideal-invention
lewing f6aa26d
Fix argument order for the box type test helper
lewing f226e24
Make Runtime_131377 a normal merged test, comment the arg swap
lewing a53d8e1
Match RhUnboxTypeTest to the new Unbox_TypeTest argument order
lewing 4a20aa8
Revert "Match RhUnboxTypeTest to the new Unbox_TypeTest argument order"
lewing 2247634
Fix the reversed unbox cast message in Unbox_TypeTest_Helper
lewing File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
36 changes: 36 additions & 0 deletions
36
src/tests/JIT/Regression/JitBlue/Runtime_131377/Runtime_131377.cs
This file contains hidden or 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,36 @@ | ||
| // Licensed to the .NET Foundation under one or more agreements. | ||
| // The .NET Foundation licenses this file to you under the MIT license. | ||
|
|
||
| // Stack allocating a box retargets its unbox to the void UNBOX_TYPETEST helper, but the call kept | ||
| // its byref type, so wasm emitted a value-returning call_indirect and trapped. The non-Guid arg is | ||
| // load bearing: a same-type unbox skips the helper. Only reproduces under crossgen wasm R2R. | ||
|
|
||
| using System; | ||
| using System.Runtime.CompilerServices; | ||
| using Xunit; | ||
|
|
||
| public class Runtime_131377 | ||
| { | ||
| [Fact] | ||
| public static void TestEntryPoint() | ||
| { | ||
| Unbox(null); | ||
| Assert.Throws<InvalidCastException>(() => Unbox("not a guid")); | ||
| } | ||
|
|
||
| [MethodImpl(MethodImplOptions.NoInlining)] | ||
| private static void Unbox(object o) | ||
| { | ||
| if (o is null) | ||
| { | ||
| o = new Guid(); | ||
| } | ||
|
|
||
| Consume((Guid)o); | ||
| } | ||
|
|
||
| [MethodImpl(MethodImplOptions.NoInlining)] | ||
| private static void Consume<T>(T _) | ||
| { | ||
| } | ||
| } |
This file contains hidden or 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.