Skip to content

Commit

Permalink
docs: fix broken guest code
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisdickinson committed Nov 30, 2023
1 parent df3949a commit 98e1087
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions docs/source/usage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -209,11 +209,11 @@ Guest Code
(memory $memory (export "mem")
(data "{\"message\": \"Hello from WAT!\"}\00")
)
(func $my_func (result i64)
(func $my_func (result i32)
(local $result i64)
(local $offset i64)
(local $i i32)
(local.set $offset (call $extism_alloc (i64.const 15)))
(local.set $offset (call $extism_alloc (i64.const 31)))

(;
You can read this as:
Expand Down Expand Up @@ -242,7 +242,6 @@ Guest Code
)

(; call the host and store the resulting offset into extism memory in a local variable. ;)
local.get $offset
(local.set $result (call $hello (local.get $offset)))

(;
Expand All @@ -253,7 +252,8 @@ Guest Code
(local.get $result)
(call $extism_length (local.get $result))
)

(i32.const 0)
)
(export "my_func" (func $my_func))
)

0 comments on commit 98e1087

Please sign in to comment.