From 527757b454f087e0e9ee5adf7ba33164413e1a3f Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Fri, 13 Mar 2026 10:39:17 -0700 Subject: [PATCH 1/2] go --- src/wasm-interpreter.h | 6 ++-- test/lit/exec/cont_bindings.wast | 47 ++++++++++++++++++++++++++++++++ 2 files changed, 50 insertions(+), 3 deletions(-) create mode 100644 test/lit/exec/cont_bindings.wast diff --git a/src/wasm-interpreter.h b/src/wasm-interpreter.h index 5e6b0cb3e51..369745d0b67 100644 --- a/src/wasm-interpreter.h +++ b/src/wasm-interpreter.h @@ -4775,9 +4775,9 @@ class ModuleRunnerBase : public ExpressionRunner { auto old = cont.getSingleValue().getContData(); auto newData = *old; newData.type = curr->type.getHeapType(); - newData.resumeArguments = arguments; - // We handle only the simple case of applying all parameters, for now. TODO - assert(old->resumeArguments.empty()); + for (auto arg : arguments) { + newData.resumeArguments.push_back(arg); + } // The old one is done. old->executed = true; return Literal(std::make_shared(newData)); diff --git a/test/lit/exec/cont_bindings.wast b/test/lit/exec/cont_bindings.wast new file mode 100644 index 00000000000..b216ac26cb1 --- /dev/null +++ b/test/lit/exec/cont_bindings.wast @@ -0,0 +1,47 @@ +;; NOTE: Assertions have been generated by update_lit_checks.py --output=fuzz-exec and should not be edited. + +;; RUN: foreach %s %t wasm-opt -all --fuzz-exec-before -q -o /dev/null 2>&1 | filecheck %s + +(module + (import "fuzzing-support" "log-i32" (func $log-i32 (param i32))) + (import "fuzzing-support" "log-f64" (func $log-f64 (param f64))) + + (rec + (type $F1 (func (param i32 f64))) + (type $F2 (func (param f64))) + (type $F3 (func)) + + (type $C1 (cont $F1)) + (type $C2 (cont $F2)) + (type $C3 (cont $F3)) + ) + + (func $f1 (type $F1) (param $x i32) (param $y f64) + (call $log-i32 + (local.get $x) + ) + (call $log-f64 + (local.get $y) + ) + ) + + ;; CHECK: [fuzz-exec] calling bindings + ;; CHECK-NEXT: [LoggingExternalInterface logging 42] + ;; CHECK-NEXT: [LoggingExternalInterface logging 3.14159] + (func $bindings (export "bindings") + ;; Start with an $F1 with two params, then bind each param in successive + ;; operations. + (resume $C3 + (cont.bind $C2 $C3 + (f64.const 3.14159) + (cont.bind $C1 $C2 + (cont.new $C1 + (i32.const 42) + (ref.func $f1) + ) + ) + ) + ) + ) +) + From 743460acbb6b8cc6eaea7874614e63e28f2782d9 Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Fri, 13 Mar 2026 10:41:18 -0700 Subject: [PATCH 2/2] oops --- test/lit/exec/cont_bindings.wast | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/lit/exec/cont_bindings.wast b/test/lit/exec/cont_bindings.wast index b216ac26cb1..ace6eac773c 100644 --- a/test/lit/exec/cont_bindings.wast +++ b/test/lit/exec/cont_bindings.wast @@ -35,8 +35,8 @@ (cont.bind $C2 $C3 (f64.const 3.14159) (cont.bind $C1 $C2 + (i32.const 42) (cont.new $C1 - (i32.const 42) (ref.func $f1) ) )