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.
[ ] This has been discussed in issue #..., or if not, please tell us why
here.[ ] A short description of what this does, why it is needed; if the
description becomes long, the matter should probably be discussed in an issue
first.[ ] This PR contains test cases, if meaningful.
- [ ] A reviewer from the core maintainer team has been assigned for this PR.
If you don't know who could review this, please indicate so. The list of
suggested reviewers on the right can help you.Please ensure all communication adheres to the code of conduct.
-->
alexcrichton submitted PR review.
alexcrichton created PR review comment:
Could this assert that the size of this field is 1 so the endianness is known to not matter?
alexcrichton submitted PR review.
uweigand updated PR #3016 from wasm-readdir-be
to main
.
uweigand submitted PR review.
uweigand created PR review comment:
Like this? Patch updated.
alexcrichton merged PR #3016.
Last updated: Nov 22 2024 at 17:03 UTC