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..ace6eac773c --- /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 + (i32.const 42) + (cont.new $C1 + (ref.func $f1) + ) + ) + ) + ) + ) +) +