Skip to content

[48.0.0] Some more backports - #14138

Merged
alexcrichton merged 8 commits into
bytecodealliance:release-48.0.0from
alexcrichton:more-backports
Aug 14, 2026
Merged

[48.0.0] Some more backports#14138
alexcrichton merged 8 commits into
bytecodealliance:release-48.0.0from
alexcrichton:more-backports

Conversation

m0g3r and others added 7 commits August 14, 2026 07:37
…nce#14130)

generate_simulated_dwarf unwrapped the first core-module translation to
name its compilation unit, but a component with no core modules has no
translations, so `wasmtime compile -D debug-info=y` panicked on a valid
`(component)` input. Return early instead: with no translations there are
no functions to describe.
* Shuffle more finalizers in the C API

This implements a similar refactoring to bytecodealliance#14126 but for the component
linker as well.

* Clang-format
…odealliance#14111)

Alias analysis's dead-store elimination removed the dead store's `mem_values`
entry, but left the region's last-store slot naming the instruction it had just
deleted. Leaving the removed-store meant that when we then reprocess the
overwriting store, we keyed its lookup on a removed instruction, found nothing,
and failed to notice that (for example) the overwriting store became idempotent
and could also be removed.

With this commit, each store now records the memory version it displaced, and
eliminating a dead store rolls that version back, so a chain like

    v1 = load.i32 region0 v0
    store region0 v2, v0  ;; dead
    store region0 v1, v0  ;; idempotent once the dead store is gone

collapses in the single pass we actually make, rather than removing only one
link in the chain and requiring that we do N passes to fully clean up a chain of
N dead/idempotent stores. This code pattern the shape fused sync adapters emit
around the `MAY_LEAVE` flag and the relevant disas tests each lose a store as a
result.
…ecodealliance#14134)

* Alias analysis: do not restore the last-fence into a region slot

When we eliminate a dead store, we undo the effects that the dead store had on
the `LastStore` state. However, querying the last store for a particular region
falls back to the last fence, and we were incorrectly restoring that last fence
into the region slot, rather than resetting the region slot to `None`. While
technically incorrect, it was generally benign, but it did lead to "observing"
instructions that we didn't mark observed during our initial observation pass,
which ultimately led to debug assertion failures.

Fixes bytecodealliance#14131

* untrim whitespace in filetests
…liance#14135)

* wasip2: return is-directory when a directory fd is used as a file

Descriptor::file() treated a directory as a bad descriptor. POSIX
read/write on a directory is EISDIR, and wasi:filesystem already has
is-directory. Preview1 guests still get EBADF (separate match and
adapter).

Signed-off-by: Sebastien Tardif <sebtardif@ncf.ca>

* wasip2: map is-directory only on read-via-stream

Descriptor::file() must stay bad-descriptor for directories.
wasi-testsuite filesystem-advise expects that for advise.
Return is-directory from read-via-stream only (p2 result, p3
result future) so a directory read matches POSIX EISDIR.

Signed-off-by: Sebastien Tardif <sebtardif@ncf.ca>

---------

Signed-off-by: Sebastien Tardif <sebtardif@ncf.ca>
@alexcrichton
alexcrichton requested review from a team as code owners August 14, 2026 14:41
@alexcrichton
alexcrichton requested review from dicej and fitzgen and removed request for a team August 14, 2026 14:41
@alexcrichton
alexcrichton merged commit c267eed into bytecodealliance:release-48.0.0 Aug 14, 2026
196 checks passed
@alexcrichton
alexcrichton deleted the more-backports branch August 14, 2026 15:19
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.

7 participants