From 559b6769713bb1f1a0575e403a97b576c4075cca Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Tue, 8 Sep 2026 10:42:00 -0700 Subject: [PATCH 1/2] go --- src/wasm-interpreter.h | 3 +++ test/lit/exec/resume_throw_ref.wast | 21 +++++++++++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 test/lit/exec/resume_throw_ref.wast diff --git a/src/wasm-interpreter.h b/src/wasm-interpreter.h index 56fccaebebe..6b4333746ed 100644 --- a/src/wasm-interpreter.h +++ b/src/wasm-interpreter.h @@ -5156,6 +5156,9 @@ class ModuleRunnerBase : public ExpressionRunner { } else { // resume_throw_ref contData->exception = arguments[0]; + if (contData->exception.isNull()) { + trap("null ref"); + } } } diff --git a/test/lit/exec/resume_throw_ref.wast b/test/lit/exec/resume_throw_ref.wast new file mode 100644 index 00000000000..21c07e11616 --- /dev/null +++ b/test/lit/exec/resume_throw_ref.wast @@ -0,0 +1,21 @@ +;; NOTE: Assertions have been generated by update_lit_checks.py --all-items --output=fuzz-exec and should not be edited. + +;; RUN: wasm-opt %s -all --fuzz-exec-before -q -o /dev/null 2>&1 | filecheck %s + +(module + (type $empty (func)) + (type $cont (cont $empty)) + + (func $empty + ) + + (func $test (export "test") + (resume_throw_ref $cont + (ref.null noexn) + (cont.new $cont + (ref.func $empty) + ) + ) + ) +) + From 6ea7efedd7192a487d1d475893c5be82c909ba13 Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Tue, 8 Sep 2026 10:42:34 -0700 Subject: [PATCH 2/2] test --- test/lit/exec/resume_throw_ref.wast | 3 +++ 1 file changed, 3 insertions(+) diff --git a/test/lit/exec/resume_throw_ref.wast b/test/lit/exec/resume_throw_ref.wast index 21c07e11616..43518f3b2e3 100644 --- a/test/lit/exec/resume_throw_ref.wast +++ b/test/lit/exec/resume_throw_ref.wast @@ -9,7 +9,10 @@ (func $empty ) + ;; CHECK: [fuzz-exec] export test + ;; CHECK-NEXT: [trap null ref] (func $test (export "test") + ;; The exnref here is null, which we trap on. (resume_throw_ref $cont (ref.null noexn) (cont.new $cont