From ee20b4d65bf56a482e22d818ef33f87c75e9670b Mon Sep 17 00:00:00 2001 From: Ryan Scott Date: Thu, 1 Aug 2024 07:32:42 -0400 Subject: [PATCH] crucible-wasm: Adapt to new data segment format in Wasm 2.0 This bumps the `haskell-wasm` commit to https://github.com/SPY/haskell-wasm/commit/32392dcc29ef3fef3a0e363d3c04d44f3082c881 and does the minimum amount of work needed to make `crucible-wasm` continue to compile after these changes. For now, we do not implement full support for Wasm 2.0's new data segment features, as that would require a non-trivial amount of work to support. See #1228. --- crucible-wasm/src/Lang/Crucible/Wasm/Instantiate.hs | 6 +++++- dependencies/haskell-wasm | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/crucible-wasm/src/Lang/Crucible/Wasm/Instantiate.hs b/crucible-wasm/src/Lang/Crucible/Wasm/Instantiate.hs index 786f452ed..5c8966e0c 100644 --- a/crucible-wasm/src/Lang/Crucible/Wasm/Instantiate.hs +++ b/crucible-wasm/src/Lang/Crucible/Wasm/Instantiate.hs @@ -388,7 +388,11 @@ computeDataSegment :: Wasm.DataSegment -> InstM (GlobalVar WasmMem, Word32, LBS.ByteString) computeDataSegment i Wasm.DataSegment{ .. } = - do st <- lift get + do (memIndex, offset) <- + case dataMode of + Wasm.ActiveData memIndex offset -> pure (memIndex, offset) + Wasm.PassiveData -> unimplemented "Passive data segments" + st <- lift get case resolveMemIndex memIndex i of Nothing -> instErr ("Could not resolve memory index " <> fromString (show memIndex)) Just (_,_,addr) -> diff --git a/dependencies/haskell-wasm b/dependencies/haskell-wasm index c743e11ff..32392dcc2 160000 --- a/dependencies/haskell-wasm +++ b/dependencies/haskell-wasm @@ -1 +1 @@ -Subproject commit c743e11ffd621c871ab98068fee4d08f21f42d14 +Subproject commit 32392dcc29ef3fef3a0e363d3c04d44f3082c881