wasmer
wasmer copied to clipboard
WebAssembly Custom Sections aren't serialized with Module.
Describe the bug
When loading a module that contains custom sections using Module::Deserialize()
and then serializing it using Module::Serialize()
then the custom sections disappear. It appears to only serialize the compiled machine code and not the custom sections. This seems to be true for the Wasmer universal format as well as when compiling it with LLVM or Cranelift.
The Wasmer version I'm using is version 3.3
rustc 1.69.0 (84c898d65 2023-04-16) binary: rustc commit-hash: 84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc commit-date: 2023-04-16 host: x86_64-pc-windows-msvc release: 1.69.0 LLVM version: 15.0.7
Steps to reproduce
- Load a module using
Module::deserialize()
- Serialze the loaded module using
Module::serialize()
- Load the serialized module using
Module::deserialize()
- Now the custom sections are gone.
Expected behavior
I would expect the custom sections to be serialized as well.
Actual behavior
The custom sections are not included in the serialization and thus disappears.