Skip to content

Commit 2c59fb5

Browse files
committed
fix block type
1 parent 70b7584 commit 2c59fb5

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/wasm/wasm-ir-builder.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -932,15 +932,15 @@ Result<> IRBuilder::visitEnd() {
932932
if (!label) {
933933
return curr;
934934
}
935+
auto blockType =
936+
scope.labelUsed ? originalScopeType : scope.getResultType();
935937
// We can re-use unnamed blocks instead of wrapping them.
936938
if (auto* block = curr->dynCast<Block>(); block && !block->name) {
937939
block->name = label;
940+
block->type = blockType;
938941
return block;
939942
}
940-
return builder.makeBlock(label,
941-
{curr},
942-
scope.labelUsed ? originalScopeType
943-
: scope.getResultType());
943+
return builder.makeBlock(label, {curr}, blockType);
944944
};
945945

946946
if (auto* func = scope.getFunction()) {

0 commit comments

Comments
 (0)