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

Switch SP and memory offset to uint32 #1

Closed
codefromthecrypt opened this issue Jun 4, 2022 · 4 comments
Closed

Switch SP and memory offset to uint32 #1

codefromthecrypt opened this issue Jun 4, 2022 · 4 comments

Comments

@codefromthecrypt
Copy link

There are some confusing code in the source wasm_exec.js which is about forcing unsigned numbers. The memory offset and stack pointer should both be uint32 not int32 where possible.

This is the correct way to force unsigned in go. The javascript does it via sp >>>= 0; which can be wholesale removed here as it has no effect, regardless of if the variable types are changed.

golang/go@9848e93

@prep
Copy link
Owner

prep commented Jun 5, 2022

Yes, fair point. I set out to mimic as much of the original wasm_exec.js as possible to get things working quickly and spot deviations more easily. Now that things are starting to work, I'll sort things like this out 👍

@codefromthecrypt
Copy link
Author

sounds good. PS I'm starting a reference doc here and will continue tomorrow https://github.com/tetratelabs/wazero/pull/621/files just in case the notes help

@prep
Copy link
Owner

prep commented Jun 5, 2022

Very nice! I've pushed some changes including the change to uint32 for offset and length.

@codefromthecrypt
Copy link
Author

thanks!

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

No branches or pull requests

2 participants