Open
Conversation
rossberg
reviewed
Mar 12, 2026
interpreter/binary/decode.ml
Outdated
| let has_paget = (flags land 8 = 8) in | ||
| let min = uN s in | ||
| let max = opt uN has_max s in | ||
| let ps = if has_paget then Int32.to_int(u32 s) else 16 in |
Member
There was a problem hiding this comment.
Now that I notice the cast, I think PageT should carry an int32. The abstract syntax usually tries to reflect value ranges as precisely as it can.
Contributor
Author
There was a problem hiding this comment.
Yeah, it's getting to be annoying. Given that it's a log representation now, should we use something even tighter, like a byte (even though it's encoded as an LEB)?
rossberg
reviewed
Mar 12, 2026
interpreter/binary/encode.ml
Outdated
| let flags = flag (max <> None) 0 + flag (at = I64AT) 2 in | ||
| byte flags; u64 min; opt u64 max | ||
|
|
||
| let memorylimits at {min; max} (PageT ps) = |
Contributor
Author
There was a problem hiding this comment.
Sorry, I don't quite understand what this comment means.
Co-authored-by: Andreas Rossberg <rossberg@mpi-sws.org>
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.
@rossberg PTAL, thanks!