Stream: git-wasmtime

Topic: wasmtime / PR #11319 Make `Val::to_raw` a safe function


view this post on Zulip Wasmtime GitHub notifications bot (Jul 24 2025 at 19:40):

alexcrichton opened PR #11319 from alexcrichton:to-raw-is-safe to bytecodealliance:main:

This commit updates Wasmtime's core Val::to_raw function a safe function. This was previously marked as unsafe with documentation that the raw pointer could be invalid, but that's not a reason for the function itself to be unsafe. Usage of the returned value is still unsafe, but simply acquiring the value is not itself an unsafe operation.

This additionally marks a number of GC-related from_raw functions as safe. Wasmtime's GC is safe in the face of heap corruption, so it's memory safe to pass in any 32-bit value. Documentation still indicates that panics are possible, however.

<!--
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 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 (Jul 24 2025 at 19:40):

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

view this post on Zulip Wasmtime GitHub notifications bot (Jul 24 2025 at 19:40):

alexcrichton requested fitzgen for a review on PR #11319.

view this post on Zulip Wasmtime GitHub notifications bot (Jul 24 2025 at 20:18):

fitzgen submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Jul 24 2025 at 20:43):

fitzgen merged PR #11319.


Last updated: Dec 06 2025 at 07:03 UTC