-
Notifications
You must be signed in to change notification settings - Fork 5.3k
[coreclr] Make sure native string resource array(s) are sorted #122441
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
[coreclr] Make sure native string resource array(s) are sorted #122441
Conversation
So that binary search works properly. This updates bash script with similar change as dotnet#122403 did for powershell script.
|
Tagging subscribers to this area: @dotnet/area-system-resources |
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.
Pull request overview
This PR fixes a bug in the bash script that generates native string resource arrays for CoreCLR by ensuring the resource entries are sorted numerically by ID. Without sorting, binary search operations performed by bsearch() in LoadNativeStringResource() will not work correctly.
Key changes:
- Modified the bash script to sort resource array keys numerically before generating output, matching the existing PowerShell script behavior
|
The bash change is not needed, it generates things sorted already. |
|
The order is not guaranteed AFAIK. https://www.gnu.org/software/bash/manual/html_node/Arrays.html doesn't specify it, so I think it is implementation specific. |
|
Hmm, we never had an issue with that on any Unix OS. Ok, the added sort doesn't hurt. |
|
/ba-g the failing test is timeout, the hidden one is unrelated (failing on windows) |
So that binary search works properly.
This updates bash script with similar change as
#122403 did for powershell script.