Created
June 2, 2023 00:05
-
-
Save codefromthecrypt/96a42e333fb6efebae17b4bf5ce27ec2 to your computer and use it in GitHub Desktop.
work around for weird ABI that expect the host to export memory
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(module $env | |
;; import and re-export logstr. the exported function has the same signature | |
;; and passes the parameters via local.get 0..n | |
(import "host" "logstr" (func $logstr (param i32))) | |
(func (export "logstr") (param i32) | |
(call $logstr (local.get 0))) | |
(memory (export "memory") 1) | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment