Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/wasm-interpreter.h
Original file line number Diff line number Diff line change
Expand Up @@ -4775,9 +4775,9 @@ class ModuleRunnerBase : public ExpressionRunner<SubType> {
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<ContData>(newData));
Expand Down
47 changes: 47 additions & 0 deletions test/lit/exec/cont_bindings.wast
Original file line number Diff line number Diff line change
@@ -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)
)
)
)
)
)
)

Loading