diff --git a/CHANGELOG.md b/CHANGELOG.md index 1ebc7464..5bc6ef28 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,7 @@ ## Unreleased +- Always use an `unsafe` block to `unsafe_main_ptr`. ([#643](https://github.com/fastly/Viceroy/pull/643)) + ## 0.19.0 (2026-06-16) - Fix adapter codegen to avoid memory shift overflow, and support SIMD instructions. ([#629](https://github.com/fastly/Viceroy/pull/629)) diff --git a/wasm_abi/adapter/src/macros.rs b/wasm_abi/adapter/src/macros.rs index 2471dc60..496467e6 100644 --- a/wasm_abi/adapter/src/macros.rs +++ b/wasm_abi/adapter/src/macros.rs @@ -42,7 +42,10 @@ macro_rules! main_ptr { #[cfg(feature = "noshift")] macro_rules! unsafe_main_ptr { ($ptr:expr) => {{ - $ptr + // Always wrap `$ptr` in `unsafe` for consistency with the + // `not(feature = "noshift")` version. + #[allow(unused_unsafe)] + unsafe { $ptr } }}; } #[cfg(feature = "noshift")] diff --git a/wasm_abi/data/viceroy-component-adapter.library.noshift.wasm b/wasm_abi/data/viceroy-component-adapter.library.noshift.wasm index 0bd29846..ba5d6642 100755 Binary files a/wasm_abi/data/viceroy-component-adapter.library.noshift.wasm and b/wasm_abi/data/viceroy-component-adapter.library.noshift.wasm differ diff --git a/wasm_abi/data/viceroy-component-adapter.library.wasm b/wasm_abi/data/viceroy-component-adapter.library.wasm index c6070c28..7b4508f6 100755 Binary files a/wasm_abi/data/viceroy-component-adapter.library.wasm and b/wasm_abi/data/viceroy-component-adapter.library.wasm differ diff --git a/wasm_abi/data/viceroy-component-adapter.noshift.wasm b/wasm_abi/data/viceroy-component-adapter.noshift.wasm index efdca074..6e627256 100755 Binary files a/wasm_abi/data/viceroy-component-adapter.noshift.wasm and b/wasm_abi/data/viceroy-component-adapter.noshift.wasm differ diff --git a/wasm_abi/data/viceroy-component-adapter.wasm b/wasm_abi/data/viceroy-component-adapter.wasm index d09a8e12..be72657d 100755 Binary files a/wasm_abi/data/viceroy-component-adapter.wasm and b/wasm_abi/data/viceroy-component-adapter.wasm differ