Skip to content

Commit 27cfe17

Browse files
committed
[GC] Add missing type validation on structGet. fixes #8095
1 parent 0e2eb12 commit 27cfe17

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/wasm/wasm-ir-builder.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2168,6 +2168,9 @@ Result<> IRBuilder::makeStructGet(HeapType type,
21682168
Index field,
21692169
bool signed_,
21702170
MemoryOrder order) {
2171+
if (!type.isStruct()) {
2172+
return Err{"expected struct type annotation on struct.get"};
2173+
}
21712174
const auto& fields = type.getStruct().fields;
21722175
StructGet curr;
21732176
CHECK_ERR(ChildPopper{*this}.visitStructGet(&curr, type));

0 commit comments

Comments
 (0)