-
Notifications
You must be signed in to change notification settings - Fork 460
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Replaced explicit truncation on memory store with implicit truncation+comment #85
Replaced explicit truncation on memory store with implicit truncation+comment #85
Conversation
@@ -91,7 +91,8 @@ let load64 mem a = | |||
Int64.logor (Int64.of_int32 (load32 mem a)) (Int64.shift_left (Int64.of_int32 (load32 mem (a+4))) 32) | |||
|
|||
let store8 mem a bits = | |||
!mem.{a} <- Int32.to_int (Int32.logand bits (Int32.of_int 255)) | |||
(* Store "bits" at byte index a; this implicitly truncates all but the lowest 8 bits of "bits". *) |
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.
I apologize for being pedantic, but "truncate" in wasm spec lingo means discarding least-significant digits of a value. How about "this stores just the low 8 bits of "bits", discarding the rest"?
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.
Updated.
lgtm; thanks! Merging based on my own lgtm because this is a minor change that I don't expect will be controversial. |
Replaced explicit truncation on memory store with implicit truncation+comment
Use plain type substitution instead of type addresses and static/dynamic types
* Revert "Allow cont ref to be non-null in switch (WebAssembly#85)" This reverts commit 92cbcc5. * Remove other unnecessary `null?` in instruction typing
As requested by @sunfishcode here