Skip to content

Commit 98e1087

Browse files
author
Chris Dickinson
committed
docs: fix broken guest code
1 parent df3949a commit 98e1087

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

docs/source/usage.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -209,11 +209,11 @@ Guest Code
209209
(memory $memory (export "mem")
210210
(data "{\"message\": \"Hello from WAT!\"}\00")
211211
)
212-
(func $my_func (result i64)
212+
(func $my_func (result i32)
213213
(local $result i64)
214214
(local $offset i64)
215215
(local $i i32)
216-
(local.set $offset (call $extism_alloc (i64.const 15)))
216+
(local.set $offset (call $extism_alloc (i64.const 31)))
217217

218218
(;
219219
You can read this as:
@@ -242,7 +242,6 @@ Guest Code
242242
)
243243

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

248247
(;
@@ -253,7 +252,8 @@ Guest Code
253252
(local.get $result)
254253
(call $extism_length (local.get $result))
255254
)
255+
256+
(i32.const 0)
256257
)
257258
(export "my_func" (func $my_func))
258259
)
259-

0 commit comments

Comments
 (0)