Skip to content

Commit

Permalink
wip: get imports working
Browse files Browse the repository at this point in the history
  • Loading branch information
zshipko committed Sep 10, 2024
1 parent 8d2450d commit 3dc46c7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion bin/src/shim.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ pub(crate) fn generate(
.export(&export.name);
let builder = func.builder();
builder.push(Instr::Call(__arg_start.index()));
for (parami, param) in export.params.clone().into_iter().enumerate() {
for (parami, param) in export.params.iter().enumerate() {
builder.push(Instr::LocalGet(parami as u32));

match param {
Expand Down
2 changes: 2 additions & 0 deletions lib/src/prelude.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,10 @@ def inner(func):
def wrapper(*args):
print(f"CALL IMPORT {idx}: {module}::{name}")
if "return" in func.__annotations__:
print("WITH RETURN")
ffi.__invoke_host_func(idx, *args)
else:
print("NO RETURN")
ffi.__invoke_host_func0(idx, *args)

return wrapper
Expand Down

0 comments on commit 3dc46c7

Please sign in to comment.