From 2dfa01f09071ab78e8134fee5c96bcd022330635 Mon Sep 17 00:00:00 2001 From: Heejin Ahn Date: Tue, 16 Jan 2024 15:19:18 -0800 Subject: 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. --- src/wasm-builder.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/wasm-builder.h b/src/wasm-builder.h index 0c3cec5c2..4b5df766d 100644 --- a/src/wasm-builder.h +++ b/src/wasm-builder.h @@ -1338,11 +1338,14 @@ public: block = any->dynCast(); } 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; -- cgit v1.2.3