Fix atomic RMW8/16/32 alignment checks using wrong max alignment#577
Merged
titzer merged 2 commits intotitzer:masterfrom Mar 4, 2026
Merged
Fix atomic RMW8/16/32 alignment checks using wrong max alignment#577titzer merged 2 commits intotitzer:masterfrom
titzer merged 2 commits intotitzer:masterfrom
Conversation
Atomic RMW sub-word operations (SUB, AND, XCHG variants) have incorrect maximum alignment values due to copy-paste from the full-width RMW entries: - RMW8 ops used 4 (i32) or 8 (i64) instead of 1 - RMW16 ops used 4 (i32) or 8 (i64) instead of 2 - RMW32 ops used 8 instead of 4 This causes the validator to accept over-aligned atomic accesses that should be rejected. Fix all 15 affected entries to match the correct sub-word alignment (consistent with ADD, OR, XOR, and CMPXCHG which were already correct).
titzer
approved these changes
Mar 3, 2026
Owner
titzer
left a comment
There was a problem hiding this comment.
Thanks, can you please add regression tests for these?
Verify that i32.atomic.rmw8.sub_u with over-aligned memarg (align=2) is correctly rejected. RMW8 operations must have max alignment of 1.
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.
Summary
Details
CodeValidator.v3:1169-1201— 15 entries affected:The ADD, OR, XOR, and CMPXCHG groups already had correct values. Only SUB, AND, and XCHG were affected.