Skip to content

Commit

Permalink
crucible-wasm: Adapt to new data segment format in Wasm 2.0
Browse files Browse the repository at this point in the history
This bumps the `haskell-wasm` commit to
SPY/haskell-wasm@32392dc
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.
  • Loading branch information
RyanGlScott committed Aug 1, 2024
1 parent f7c697e commit ee20b4d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion crucible-wasm/src/Lang/Crucible/Wasm/Instantiate.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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) ->
Expand Down

0 comments on commit ee20b4d

Please sign in to comment.