wast-parser: make IsPowerOfTwo support memory64 addresses#2681
Merged
Conversation
sbc100
reviewed
Jan 14, 2026
| static const size_t kMaxErrorTokenLength = 80; | ||
|
|
||
| bool IsPowerOfTwo(uint32_t x) { | ||
| bool IsPowerOfTwo(const Address& x) { |
Member
There was a problem hiding this comment.
I think that can just be Address x, no?
| (memory 1) | ||
| (func | ||
| i32.const 0 | ||
| i32.load offset=0xFFFF_FFFF_FFFF_FFFF align=0x8000_0000_0000_0000 |
Member
There was a problem hiding this comment.
If this exists in align.wast why doesn't the normal test suite run catch this bug?
Contributor
Author
There was a problem hiding this comment.
If this exists in align.wast why doesn't the normal test suite run catch this bug?
The test came into existence here at WebAssembly/testsuite@4b24564, which I suspect is newer than the version in wabt's copy of the spec tests in third_party.
Member
There was a problem hiding this comment.
Ah, I see. In that case can you maybe add a comment with a link to that commit and a TODO to remove this test once we update the testsuite?
6f2fd09 to
991e96c
Compare
991e96c to
4a492da
Compare
sbc100
approved these changes
Jan 14, 2026
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.
No description provided.