Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replaced explicit truncation on memory store with implicit truncation+comment #85

Merged

Conversation

AndrewScheidecker
Copy link
Contributor

As requested by @sunfishcode here

@@ -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". *)
Copy link
Member

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"?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated.

@sunfishcode
Copy link
Member

lgtm; thanks! Merging based on my own lgtm because this is a minor change that I don't expect will be controversial.

sunfishcode added a commit that referenced this pull request Sep 25, 2015
Replaced explicit truncation on memory store with implicit truncation+comment
@sunfishcode sunfishcode merged commit 70817af into WebAssembly:master Sep 25, 2015
@AndrewScheidecker AndrewScheidecker deleted the removed_magic_from_memory branch November 24, 2015 01:30
littledan pushed a commit to littledan/spec that referenced this pull request Mar 4, 2018
dhil pushed a commit to dhil/webassembly-spec that referenced this pull request Apr 25, 2023
Use plain type substitution instead of type addresses and static/dynamic types
dhil pushed a commit to dhil/webassembly-spec that referenced this pull request Oct 21, 2024
dhil pushed a commit to dhil/webassembly-spec that referenced this pull request Oct 21, 2024
* Revert "Allow cont ref to be non-null in switch (WebAssembly#85)"

This reverts commit 92cbcc5.

* Remove other unnecessary `null?` in instruction typing
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants