Stream: git-wasmtime

Topic: wasmtime / PR #14782 Represent globals as a proper `union...


view this post on Zulip Wasmtime GitHub notifications bot (Oct 16 2026 at 15:21):

alexcrichton opened PR #14782 from alexcrichton:refactor-globals to bytecodealliance:main:

This commit refactors the representation of VMGlobalDefinition which for the longest time has been [u8; 16] and IIRC predates the addition of union to Rust. The previous implementation had a bug where funcref fields were loaded/stored as *mut VMFuncRef but this is not compatible with provenance and Pulley. Instead globals needed to use Option<VmPtr<VMFuncRef>>, and instead of just fixing this one case for globals I've refactored globals to use a union.

The change here reflects the internal representation of wasm globals and how Cranelift accesses them. Documentation is additionally added indicating that some fields are little-endian and some are native-endian. The field type for funcref is Option<VmPtr<_>> to resolve the provenance issue as well.

<!--
Please make sure you include the following information:

Our development process is documented in the Wasmtime book:
https://docs.wasmtime.dev/contributing-development-process.html

Please review the Bytecode Alliance's AI tool usage policy at
https://github.com/bytecodealliance/governance/blob/main/AI_TOOL_POLICY.md

Please ensure all communication follows the code of conduct:
https://github.com/bytecodealliance/wasmtime/blob/main/CODE_OF_CONDUCT.md
-->

view this post on Zulip Wasmtime GitHub notifications bot (Oct 16 2026 at 15:21):

alexcrichton requested fitzgen for a review on PR #14782.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 16 2026 at 15:21):

alexcrichton requested wasmtime-core-reviewers for a review on PR #14782.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 16 2026 at 15:21):

alexcrichton requested wasmtime-compiler-reviewers for a review on PR #14782.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 16 2026 at 15:56):

alexcrichton updated PR #14782.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 16 2026 at 17:45):

github-actions[bot] added the label wasmtime:api on PR #14782.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 16 2026 at 19:45):

:thumbs_up: fitzgen submitted PR review:

Thanks!

view this post on Zulip Wasmtime GitHub notifications bot (Oct 16 2026 at 19:45):

:speech_balloon: fitzgen created PR review comment:

I couldn't find a pre-existing issue on file for this TODO, mind creating one so it doesn't get lost?

view this post on Zulip Wasmtime GitHub notifications bot (Oct 16 2026 at 19:45):

:speech_balloon: fitzgen created PR review comment:

Ah, nevermind, I see the TODO didn't get lost

view this post on Zulip Wasmtime GitHub notifications bot (Oct 16 2026 at 19:45):

fitzgen added PR #14782 Represent globals as a proper union, fix provenance to the merge queue.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 16 2026 at 20:09):

:check: fitzgen merged PR #14782.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 16 2026 at 20:09):

fitzgen removed PR #14782 Represent globals as a proper union, fix provenance from the merge queue.


Last updated: Oct 31 2026 at 23:03 UTC