Skip to content

Commit 22eef3d

Browse files
authored
Fix basic example, parameter missmatch between host and wasm (#3415)
Revert the mistaken change by PR #3209.
1 parent b349d84 commit 22eef3d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

samples/basic/src/main.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ main(int argc, char *argv_main[])
175175
ret_val);
176176

177177
// Next we will pass a buffer to the WASM function
178-
uint32 argv2[5];
178+
uint32 argv2[4];
179179

180180
// must allocate buffer from wasm instance memory space (never use pointer
181181
// from host runtime)
@@ -184,8 +184,8 @@ main(int argc, char *argv_main[])
184184

185185
memcpy(argv2, &ret_val, sizeof(float)); // the first argument
186186
argv2[1] = wasm_buffer; // the second argument is the wasm buffer address
187-
argv2[3] = 100; // the third argument is the wasm buffer size
188-
argv2[4] = 3; // the last argument is the digits after decimal point for
187+
argv2[2] = 100; // the third argument is the wasm buffer size
188+
argv2[3] = 3; // the last argument is the digits after decimal point for
189189
// converting float to string
190190

191191
if (!(func2 =

0 commit comments

Comments
 (0)