Skip to content

Commit 86a01a1

Browse files
authored
SubTypes: Ensure a depth for cont (WebAssembly#8240)
Like `func`, if no subtypes exist, we must still ensure an entry (with 0).
1 parent 62ac166 commit 86a01a1

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

src/ir/subtypes.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,8 +158,9 @@ struct SubTypes {
158158
depths[HeapTypes::noexn.getBasic(share)] = 0;
159159

160160
// func would appear already if we saw function types, but if not, ensure
161-
// it exists here.
161+
// it exists here. Ditto for cont.
162162
depths[HeapTypes::func.getBasic(share)];
163+
depths[HeapTypes::cont.getBasic(share)];
163164
}
164165

165166
return depths;

test/gtest/type-builder.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1614,6 +1614,7 @@ TEST_F(TypeTest, TestMaxStructDepths) {
16141614
EXPECT_EQ(maxDepths[HeapType::nocont], Index(0));
16151615
EXPECT_EQ(maxDepths[HeapType::noexn], Index(0));
16161616
EXPECT_EQ(maxDepths[HeapType::func], Index(0));
1617+
EXPECT_EQ(maxDepths[HeapType::cont], Index(0));
16171618
}
16181619

16191620
TEST_F(TypeTest, TestMaxArrayDepths) {

0 commit comments

Comments
 (0)