mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-11-21 18:04:03 +01:00
Plugin::load now validates each module with wasmparser and a fixed list of WebAssembly features before wasmi reads it: mutable globals, sign extension, saturating conversions, multi-value, bulk memory, reference types, tail calls, extended constant expressions and floats. A module that uses any other feature is refused, so a wasmi upgrade, a change to its defaults or one of its crate features turned on elsewhere in the build does not change what a plug-in may use. wasmi's Config is set to the same list for every setter it has in this build. The list is the set wasmi accepted before, without multi-memory. A second memory was already refused by the one-memory limit; its error now says "multiple memories". No module that loaded before is refused. wasmparser 0.228.0 is the version wasmi 2.0.0 already uses. A new test loads a plug-in that uses each listed feature and checks that modules using SIMD, relaxed SIMD, memory64, a second memory, custom page sizes, wide arithmetic, threads, exceptions, legacy exceptions, function references or garbage collection are refused with an error that names the feature. docs/plugins.md lists the whole set; it named only four of the allowed features before.