Skip to content

Commit

Permalink
Use Blob arg in place of Nat32
Browse files Browse the repository at this point in the history
  • Loading branch information
rvanasa committed Jul 10, 2024
1 parent 866e778 commit 9100f65
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
8 changes: 5 additions & 3 deletions src/codegen/compile.ml
Original file line number Diff line number Diff line change
Expand Up @@ -11255,9 +11255,11 @@ and compile_prim_invocation (env : E.t) ae p es at =
| OtherPrim "wit:component:call", [e] ->
assert !Flags.import_component;
SR.UnboxedWord32 Type.Nat32,
(* compile_exp_as env ae SR.Vanilla e ^^ *)
compile_unboxed_const 0l ^^
compile_unboxed_const 0l ^^
compile_exp_as env ae SR.Vanilla e ^^
let set_blob, get_blob = new_local env "blob" in
set_blob ^^
get_blob ^^ Blob.payload_ptr_unskewed env ^^
get_blob ^^ Blob.len env ^^
E.call_import env "component" "call"

(* Other prims, nullary *)
Expand Down
2 changes: 1 addition & 1 deletion src/prelude/prim.mo
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ func log(f : Float) : Float = (prim "flog" : Float -> Float) f;
// Wasm component model functions
/// @deprecated M0200
func componentCall(b : Blob) : Blob = (prim "wit:component:call" : Blob -> Blob) b;
func componentCall(b : Blob) : Nat32 = (prim "wit:component:call" : Blob -> Nat32) b;
// Array utilities
Expand Down

0 comments on commit 9100f65

Please sign in to comment.