Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions src/wasm/wasm-ir-builder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2093,6 +2093,15 @@ Result<> IRBuilder::makeBrOn(Index label,
}
CHECK_ERR(visitBrOn(&curr));

// Validate things that would cause errors later.
if (curr.ref->type != Type::unreachable && !curr.ref->type.isRef()) {
return Err{"br_on* ref must be a ref"};
}
if (curr.desc && curr.desc->type != Type::unreachable &&
!curr.desc->type.isRef()) {
return Err{"br_on_cast_desc* must be a ref"};
}

// Validate type immediates before we forget them.
switch (op) {
case BrOnNull:
Expand Down
Loading