diff --git a/src/wasm/wasm-ir-builder.cpp b/src/wasm/wasm-ir-builder.cpp index a60dd6edc57..f49586bfb5a 100644 --- a/src/wasm/wasm-ir-builder.cpp +++ b/src/wasm/wasm-ir-builder.cpp @@ -2168,6 +2168,9 @@ Result<> IRBuilder::makeStructGet(HeapType type, Index field, bool signed_, MemoryOrder order) { + if (!type.isStruct()) { + return Err{"expected struct type annotation on struct.get"}; + } const auto& fields = type.getStruct().fields; StructGet curr; CHECK_ERR(ChildPopper{*this}.visitStructGet(&curr, type));