Stream: git-wasmtime

Topic: wasmtime / PR #3016 Fix WASI fd_readdir on big-endian


view this post on Zulip Wasmtime GitHub notifications bot (Jun 22 2021 at 12:06):

uweigand opened PR #3016 from wasm-readdir-be to main:

This code assumes that the Dirent structure has the same memory
layout on the host (Rust code) as in wasm code. This is not true
if the host is big-endian, as wasm is always little-endian.

Fixed by always byte-swapping Dirent fields to little-endian
before passing them on to wasm code.

<!--

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 (Jun 22 2021 at 14:18):

alexcrichton submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Jun 22 2021 at 14:18):

alexcrichton created PR review comment:

Could this assert that the size of this field is 1 so the endianness is known to not matter?

view this post on Zulip Wasmtime GitHub notifications bot (Jun 22 2021 at 14:18):

alexcrichton submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Jun 22 2021 at 14:56):

uweigand updated PR #3016 from wasm-readdir-be to main.

view this post on Zulip Wasmtime GitHub notifications bot (Jun 22 2021 at 14:56):

uweigand submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Jun 22 2021 at 14:56):

uweigand created PR review comment:

Like this? Patch updated.

view this post on Zulip Wasmtime GitHub notifications bot (Jun 22 2021 at 15:39):

alexcrichton merged PR #3016.


Last updated: Dec 23 2024 at 12:05 UTC