Skip to content

Commit a347f3a

Browse files
committed
Allow executing functions from Wasm modules that have failed linking
This is called for by the official spec test "linking". We keep the check only for modules eval'ed with EvalReturnsInstance, where it is possible for the embedder to obtain a WasmInstance that will fail linking. Without EvalReturnsInstance, instances must pass linking before they are returned to the embedder.
1 parent c278cf7 commit a347f3a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

wasm/src/org.graalvm.wasm/src/org/graalvm/wasm/nodes/WasmRootNode.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ public final void tryInitialize(WasmInstance instance) {
8484
// We want to ensure that linking always precedes the running of the WebAssembly code.
8585
// This linking should be as late as possible, because a WebAssembly context should
8686
// be able to parse multiple modules before the code gets run.
87-
if (!instance.isLinkCompletedFastPath()) {
87+
if (getContext().getContextOptions().evalReturnsInstance() && !instance.isLinkCompletedFastPath()) {
8888
nonLinkedProfile.enter();
8989
instance.store().linker().tryLinkFastPath(instance);
9090
}

0 commit comments

Comments
 (0)