Skip to content

Commit 5ceae45

Browse files
committed
Validate array type in IRBuilder::makeArrayGet
1 parent 0e2eb12 commit 5ceae45

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
@@ -2268,6 +2268,9 @@ Result<> IRBuilder::makeArrayNewFixed(HeapType type, uint32_t arity) {
22682268

22692269
Result<>
22702270
IRBuilder::makeArrayGet(HeapType type, bool signed_, MemoryOrder order) {
2271+
if (!type.isArray()) {
2272+
return Err{"expected array type annotation on array.get"};
2273+
}
22712274
ArrayGet curr;
22722275
CHECK_ERR(ChildPopper{*this}.visitArrayGet(&curr, type));
22732276
CHECK_ERR(validateTypeAnnotation(type, curr.ref));

0 commit comments

Comments
 (0)