Skip to content

Commit 0e5e550

Browse files
authored
Show a proper error on an invalid type in binary reading ; fixes #1872 (#1874)
1 parent 777d33d commit 0e5e550

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/wasm/wasm-binary.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -847,9 +847,9 @@ Type WasmBinaryBuilder::getType() {
847847
case BinaryConsts::EncodedType::f32: return f32;
848848
case BinaryConsts::EncodedType::f64: return f64;
849849
case BinaryConsts::EncodedType::v128: return v128;
850-
case BinaryConsts::EncodedType::AnyFunc:
851-
case BinaryConsts::EncodedType::Func:
850+
default: {
852851
throwError("invalid wasm type: " + std::to_string(type));
852+
}
853853
}
854854
WASM_UNREACHABLE();
855855
}

0 commit comments

Comments
 (0)