Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@BrzVlad
Copy link
Member

@BrzVlad BrzVlad commented Dec 23, 2021

These structures are valuetypes, but their mint_type is a primitive. This means that a LDFLD applied on the type would have attempted to do a pointer dereference, because it saw that the current top of stack is not STACK_TYPE_VT. This was fixed in the past by passing the managed pointer to the valuetype rather than the valuetype itself, against the normal call convention, which lead to inconsistencies in the code.

This commit removes that hack and fixes the problem by ignoring LDFLD applied to nint/nfloat valuetypes in the first place.

Backport of dotnet/runtime#61612

dotnet/runtime#61153

These structures are valuetypes, but their mint_type is a primitive. This means that a LDFLD applied on the type would have attempted to do a pointer dereference, because it saw that the current top of stack is not STACK_TYPE_VT. This was fixed in the past by passing the managed pointer to the valuetype rather than the valuetype itself, against the normal call convention, which lead to inconsistencies in the code.

This commit removes that hack and fixes the problem by ignoring LDFLD applied to nint/nfloat valuetypes in the first place.
@directhex
Copy link
Contributor

@monojenkins build Linux AArch64 FullAOT+LLVM

@directhex
Copy link
Contributor

@monojenkins build Windows x64 FullAOT+LLVM

@BrzVlad BrzVlad merged commit a791978 into mono:main Jan 4, 2022
@BrzVlad
Copy link
Member Author

BrzVlad commented Jan 4, 2022

/backport to 2020-02

@github-actions
Copy link
Contributor

github-actions bot commented Jan 4, 2022

Started backporting to 2020-02: https://github.com/mono/mono/actions/runs/1654664190

@github-actions
Copy link
Contributor

github-actions bot commented Jan 4, 2022

@BrzVlad backporting to 2020-02 failed, the patch most likely resulted in conflicts:

$ git am --3way --ignore-whitespace --keep-non-patch changes.patch

Applying: [interp] Remove hack for nint/nfloat
Using index info to reconstruct a base tree...
M	mono/mini/interp/transform.c
Falling back to patching base and 3-way merge...
Auto-merging mono/mini/interp/transform.c
CONFLICT (content): Merge conflict in mono/mini/interp/transform.c
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
Patch failed at 0001 [interp] Remove hack for nint/nfloat
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".
Error: The process '/usr/bin/git' failed with exit code 128

Please backport manually!

ThomasKuehne pushed a commit to ThomasKuehne/mono that referenced this pull request Mar 23, 2024
These structures are valuetypes, but their mint_type is a primitive. This means that a LDFLD applied on the type would have attempted to do a pointer dereference, because it saw that the current top of stack is not STACK_TYPE_VT. This was fixed in the past by passing the managed pointer to the valuetype rather than the valuetype itself, against the normal call convention, which lead to inconsistencies in the code.

This commit removes that hack and fixes the problem by ignoring LDFLD applied to nint/nfloat valuetypes in the first place.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants