Fix stack alignment computation (#12267)#12434
Merged
Conversation
gasche
approved these changes
Jul 28, 2023
Member
|
@dustanddreams could you rebase (there is a Changes conflict) and fixup the history? |
The previous computation would not always round up and actually truncate the allocation on 32-bit platforms, if the requested size in words is congruent to 1 modulo 4.
Author
Rebasquashed. |
Member
|
Thanks! Merged. |
Member
|
Given that there's another fix needed for 5.1 (so presumably another rc?), can I add this to the 5.1 milestone, @Octachron? (and then cherry-pick!) |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Following issue #12267, this PR:
(size + align - 1) & ~(align - 1)idiom as found isround_up()inruntime/platform.c(which can't be used directly as it local to that file).The previous computation did not round up correctly. If the top of stack would have ended up being 0x...4, it would end up truncated to 0x...0.