Skip to content

Commit

Permalink
Make blockifyWithName correctly use name and type (WebAssembly#6223)
Browse files Browse the repository at this point in the history
- 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 WebAssembly#6210, but I'm not sure how to add a standalone
test for this.
  • Loading branch information
aheejin authored and radekdoulik committed Jul 12, 2024
1 parent 3163a32 commit 5270fe4
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/wasm-builder.h
Original file line number Diff line number Diff line change
Expand Up @@ -1338,11 +1338,14 @@ class Builder {
block = any->dynCast<Block>();
}
if (!block || block->name.is()) {
block = makeBlock(any);
block = makeBlock(name, any);
} else {
block->name = name;
}
block->name = name;
if (append) {
block->list.push_back(append);
}
if (append || type) {
block->finalize(type);
}
return block;
Expand Down

0 comments on commit 5270fe4

Please sign in to comment.