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
2 changes: 1 addition & 1 deletion src/tools/execution-results.h
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ struct LoggingExternalInterface : public ShellExternalInterface {
};
// Use a null instance because this is a host function.
return Literal(std::make_shared<FuncData>(import->name, nullptr, f),
import->type);
import->type.with(Exact));
}

void throwJSException() {
Expand Down
4 changes: 3 additions & 1 deletion test/lit/exec/imported-func.wast
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,7 @@
;; CHECK-NEXT: [fuzz-exec] export cast-B-exact
;; CHECK-NEXT: [trap cast error]
;; CHECK-NEXT: [fuzz-exec] export cast-C-exact
;; CHECK-NEXT: [fuzz-exec] export cast-host-A-exact
;; CHECK-NEXT: [fuzz-exec] export cast-host-B
;; CHECK-NEXT: [trap cast error]
;; CHECK-NEXT: [fuzz-exec] export last

19 changes: 18 additions & 1 deletion test/lit/exec/imported-func.wast.second
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
)

(import "primary" "func" (func $fimport (type $A)))
(import "fuzzing-support" "log" (func $host-import (type $A)))

(func $cast-A (export "cast-A")
(drop
Expand Down Expand Up @@ -57,8 +58,24 @@
)
)

(func $cast-host-A-exact (export "cast-host-A-exact")
;; Host functions have the exact type of the import.
(drop
(ref.cast (ref (exact $A))
(ref.func $host-import)
)
)
)

(func $cast-host-B (export "cast-host-B")
(drop
(ref.cast (ref $B)
(ref.func $host-import)
)
)
)

(func $last (export "last")
;; Just a non-trapping method to make the test output easier to read.
)
)

Loading