Skip to content

Commit 2dfa01f

Browse files
authored
Make blockifyWithName correctly use name and type (#6223)
- This passes `name` to `makeBlock` call, because `makeBlock` uses `BranchSeeker` when finalizing only when the block has a `name`. - This also refinalizes the block when an optional `type` is given. This was spun off from #6210, but I'm not sure how to add a standalone test for this.
1 parent 1db044e commit 2dfa01f

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/wasm-builder.h

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1338,11 +1338,14 @@ class Builder {
13381338
block = any->dynCast<Block>();
13391339
}
13401340
if (!block || block->name.is()) {
1341-
block = makeBlock(any);
1341+
block = makeBlock(name, any);
1342+
} else {
1343+
block->name = name;
13421344
}
1343-
block->name = name;
13441345
if (append) {
13451346
block->list.push_back(append);
1347+
}
1348+
if (append || type) {
13461349
block->finalize(type);
13471350
}
13481351
return block;

0 commit comments

Comments
 (0)