-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Fix misaligned reads in NativeAOT code manager #113637
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
The fix replaces the native implementation of the native format decoder with the clone of the managed implementation. Fixes dotnet#113609
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot reviewed 22 out of 22 changed files in this pull request and generated no comments.
|
cc @dotnet/ilc-contrib |
| uintptr_t lengthBits = *pbEncoding & 0x0F; | ||
| size_t negLength = s_negLengthTab[lengthBits]; | ||
| uintptr_t shift = s_shiftTab[lengthBits]; | ||
| uint32_t result = *(PTR_uint32_t)(pbEncoding - negLength - 4); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was tricky branch-free implementation to squeeze a few extra cycles. Exception handling is the only place where it was used.
I have replaced it with clone of much more straightforward managed implementation. We can afford to spend a few cycles on decoding EH clauses...
Co-authored-by: Adeel Mujahid <3840695+am11@users.noreply.github.com>
MichalStrehovsky
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice cleanup too, thank you!
The fix replaces the native implementation of the native format decoder with the clone of the managed implementation.
Fixes #113609