From d542a41475d08817d167c75f2217e28469c33e48 Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Fri, 7 Nov 2025 13:28:58 -0800 Subject: [PATCH 1/2] Properly mark Unsubtyping as closed-world --- scripts/fuzz_opt.py | 3 ++- src/passes/Unsubtyping.cpp | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/scripts/fuzz_opt.py b/scripts/fuzz_opt.py index e5cba2772b5..f4276f58e29 100755 --- a/scripts/fuzz_opt.py +++ b/scripts/fuzz_opt.py @@ -2486,7 +2486,8 @@ def write_commands(commands, filename): ("--cfp-reftest",), ("--gsi",), ("--type-ssa",), - ("--type-merging",)} + ("--type-merging",), + ("--unsubtyping",)} def get_random_opts(): diff --git a/src/passes/Unsubtyping.cpp b/src/passes/Unsubtyping.cpp index ad371d19a28..5bc07467da8 100644 --- a/src/passes/Unsubtyping.cpp +++ b/src/passes/Unsubtyping.cpp @@ -446,6 +446,10 @@ struct Unsubtyping : Pass { return; } + if (!getPassOptions().closedWorld) { + Fatal() << "Unsubtyping requires --closed-world"; + } + // Initialize the subtype relation based on what is immediately required to // keep the code and public types valid. analyzePublicTypes(*wasm); From 60fd544480cf70c723ae680498808d1db9fbec6b Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Fri, 7 Nov 2025 13:42:29 -0800 Subject: [PATCH 2/2] fix random test --- test/lit/passes/issue-7087.wast | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/lit/passes/issue-7087.wast b/test/lit/passes/issue-7087.wast index 096c88e5d45..fab633293d5 100644 --- a/test/lit/passes/issue-7087.wast +++ b/test/lit/passes/issue-7087.wast @@ -9,7 +9,7 @@ ;; module-level code in TypeSSA and fix the validator so it would have caught ;; the stale type. -;; RUN: wasm-opt %s -all --type-ssa --unsubtyping -S -o - | filecheck %s +;; RUN: wasm-opt %s -all --type-ssa --unsubtyping --closed-world -S -o - | filecheck %s (module ;; CHECK: (rec