diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/wasm/wasm-binary.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/wasm/wasm-binary.cpp b/src/wasm/wasm-binary.cpp index 74d74f473..ee8afeb93 100644 --- a/src/wasm/wasm-binary.cpp +++ b/src/wasm/wasm-binary.cpp @@ -2243,7 +2243,15 @@ void WasmBinaryReader::verifyInt64(int64_t x) { void WasmBinaryReader::readHeader() { BYN_TRACE("== readHeader\n"); verifyInt32(BinaryConsts::Magic); - verifyInt32(BinaryConsts::Version); + auto version = getInt32(); + if (version != BinaryConsts::Version) { + if (version == 0x1000d) { + throwError("this looks like a wasm component, which Binaryen does not " + "support yet (see " + "https://github.com/WebAssembly/binaryen/issues/6728)"); + } + throwError("invalid version"); + } } void WasmBinaryReader::readStart() { |