From 53b7dd1f0f129f0304a045ea00ce92334c01fb75 Mon Sep 17 00:00:00 2001 From: Thomas Lively Date: Tue, 16 Jul 2024 16:30:36 -0400 Subject: [threads] Update TypeSSA for shared types (#6753) When creating a new subtype, make sure to copy the supertype's shareability. --- src/passes/TypeSSA.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/passes/TypeSSA.cpp b/src/passes/TypeSSA.cpp index 3736f3ccf..dcd56f5d6 100644 --- a/src/passes/TypeSSA.cpp +++ b/src/passes/TypeSSA.cpp @@ -251,10 +251,13 @@ struct TypeSSA : public Pass { auto oldType = curr->type.getHeapType(); if (oldType.isStruct()) { builder[i] = oldType.getStruct(); - } else { + } else if (oldType.isArray()) { builder[i] = oldType.getArray(); + } else { + WASM_UNREACHABLE("unexpected type kind"); } builder[i].subTypeOf(oldType); + builder[i].setShared(oldType.getShared()); builder[i].setOpen(); } builder.createRecGroup(0, num); -- cgit v1.2.3