-
Notifications
You must be signed in to change notification settings - Fork 5.1k
Fix invalid IL in RefFields test - remove ldind.ref on value type references #116416
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
Conversation
@copilot The issue here is captured in the comment by @jkotas, #116358 (comment). The point of this test was to validate the targets of the byref are identical. However, the approach I took was incorrect for value types. Instead, the solution should be to simply compare the managed pointers instead of dereferencing them in IL. The easiest way to address this would be to remove both |
…erences Co-authored-by: AaronRobinsonMSFT <30635565+AaronRobinsonMSFT@users.noreply.github.com>
Done. Both Warning Firewall rules blocked me from connecting to one or more addressesI tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
This PR fixes the intermittent failure of the
Loader/classloader/RefFields/Validate
test that was causing assertion failures inmethodtable.cpp
with the error:Root Cause
The issue was in the
WithRefStructField.ConfirmFieldInstance
method inInvalidCSharp.il
, which contained invalid IL:The problem was using
ldind.ref
to dereferenceWithRefField&
(reference to a value type).ldind.ref
is only valid for dereferencing object references, not value type references. This caused the JIT to generate incorrect GC information, leading to the assertion failure.Fix
The fix removes the invalid
ldind.ref
instructions and directly compares the twoWithRefField&
references:This correctly compares whether the stored reference in the field points to the same location as the parameter reference, which is the intended behavior of the test.
Verification
ilasm
Fixes #116358.
Warning
Firewall rules blocked me from connecting to one or more addresses
I tried to connect to the following addresses, but was blocked by firewall rules:
k0ivsblobprodcus356.vsblob.vsassets.io
/home/REDACTED/work/runtime/runtime/.dotnet/dotnet /home/REDACTED/work/runtime/runtime/.dotnet/sdk/10.0.100-preview.6.25272.112/NuGet.Build.Tasks.Console.dll Recursive=True;CleanupAssetsForUnsupportedProjects=True;DisableParallel=False;Force=False;ForceEvaluate=False;HideWarningsAndErrors=False;IgnoreFailedSources=False;Interactive=False;NoCache=False;NoHttpCache=False;RestorePackagesConfig=False /home/REDACTED/work/runtime/runtime/.dotnet/sdk/10.0.100-preview.6.25272.112/MSBuild.dll /home/REDACTED/work/runtime/runtime/src/tests/Loader/classloader/RefFields/Validate.csproj NuGetInteractive=false;MSBuildRestoreSessionId=21e5ac85-7729-4227-9df0-d7f3c485866d;MSBuildIsRestoring=True;ExcludeRestorePackageImports=True;OriginalMSBuildStartupDirectory=/home/REDACTED/work/runtime/runtime/src/tests/Loader/classloader/RefFields
(dns block)mfjvsblobprodcus373.vsblob.vsassets.io
/home/REDACTED/work/runtime/runtime/.dotnet/dotnet /home/REDACTED/work/runtime/runtime/.dotnet/sdk/10.0.100-preview.6.25272.112/NuGet.Build.Tasks.Console.dll Recursive=True;CleanupAssetsForUnsupportedProjects=True;DisableParallel=False;Force=False;ForceEvaluate=False;HideWarningsAndErrors=False;IgnoreFailedSources=False;Interactive=False;NoCache=False;NoHttpCache=False;RestorePackagesConfig=False /home/REDACTED/work/runtime/runtime/.dotnet/sdk/10.0.100-preview.6.25272.112/MSBuild.dll /home/REDACTED/work/runtime/runtime/src/tests/Loader/classloader/RefFields/Validate.csproj NuGetInteractive=false;MSBuildRestoreSessionId=21e5ac85-7729-4227-9df0-d7f3c485866d;MSBuildIsRestoring=True;ExcludeRestorePackageImports=True;OriginalMSBuildStartupDirectory=/home/REDACTED/work/runtime/runtime/src/tests/Loader/classloader/RefFields
(dns block)If you need me to access, download, or install something from one of these locations, you can either:
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.