Stream: git-wasmtime

Topic: wasmtime / PR #2383 Support big-endian hosts with GuestType


view this post on Zulip Wasmtime GitHub notifications bot (Nov 09 2020 at 16:25):

uweigand opened PR #2383 from endian-guesttype to main:

The GuestType trait is used to access data elements in guest memory.
According to the WebAssembly spec, those are always stored in
little-endian byte order, even on big-endian hosts. Accessing such
elements on big-endian hosts therefore requires byte swapping.

Fixed by adding from_le_bytes / to_le_bytes.

<!--

Please ensure that the following steps are all taken care of before submitting
the PR.

Please ensure all communication adheres to the code of conduct.
-->

view this post on Zulip Wasmtime GitHub notifications bot (Nov 09 2020 at 16:33):

alexcrichton submitted PR Review.

view this post on Zulip Wasmtime GitHub notifications bot (Nov 09 2020 at 16:33):

alexcrichton created PR Review Comment:

Instead of using [u8; ...] could the from_le and to_le methods be used?

view this post on Zulip Wasmtime GitHub notifications bot (Nov 09 2020 at 16:34):

uweigand submitted PR Review.

view this post on Zulip Wasmtime GitHub notifications bot (Nov 09 2020 at 16:34):

uweigand created PR Review Comment:

I think when I tried those, they failed for f32 and f64 types.

view this post on Zulip Wasmtime GitHub notifications bot (Nov 09 2020 at 16:36):

alexcrichton submitted PR Review.

view this post on Zulip Wasmtime GitHub notifications bot (Nov 09 2020 at 16:36):

alexcrichton created PR Review Comment:

Ah yeah that'd do it!

view this post on Zulip Wasmtime GitHub notifications bot (Nov 09 2020 at 16:36):

alexcrichton submitted PR Review.

view this post on Zulip Wasmtime GitHub notifications bot (Nov 09 2020 at 16:59):

alexcrichton merged PR #2383.


Last updated: Nov 22 2024 at 16:03 UTC