Skip to content
Merged
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
7 changes: 7 additions & 0 deletions src/coreclr/hosts/corerun/wasm/libCorerun.js
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,9 @@ function libCoreRunFactory() {
if (_posix_memalign(ptrPtr, 16, payloadSize)) {
throw new Error("posix_memalign failed for Webcil payload");
}
if (typeof (wasmExports.__stack_pointer) === "undefined") {
throw new Error("__stack_pointer was not preserved by the linker or optimizer");
Comment thread
kg marked this conversation as resolved.
Comment thread
kg marked this conversation as resolved.
}
payloadPtr = HEAPU32[ptrPtr >>> 2 >>> 0];
wasmInstance = new WebAssembly.Instance(wasmModule, {
webcil: {
Expand All @@ -229,6 +232,10 @@ function libCoreRunFactory() {
tableBase: new WebAssembly.Global({ value: "i32", mutable: false }, tableStartIndex),
imageBase: new WebAssembly.Global({ value: "i32", mutable: false }, payloadPtr)
}});
} catch (e) {
const errorMessage = e instanceof Error ? e.message : String(e);
console.error("Failed to construct WebAssembly instance for Webcil image:", {wasmPath, errorMessage});
Comment thread
kg marked this conversation as resolved.
return false;
} finally {
stackRestore(sp);
}
Expand Down
Loading