From 9100f65326184091216879f1b55759274c853e41 Mon Sep 17 00:00:00 2001 From: rvanasa Date: Wed, 10 Jul 2024 11:06:49 -0600 Subject: [PATCH] Use Blob arg in place of Nat32 --- src/codegen/compile.ml | 8 +++++--- src/prelude/prim.mo | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/codegen/compile.ml b/src/codegen/compile.ml index 762e034ae73..a7e162d1ac3 100644 --- a/src/codegen/compile.ml +++ b/src/codegen/compile.ml @@ -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 *) diff --git a/src/prelude/prim.mo b/src/prelude/prim.mo index 5a2a41a5148..69a740eebe8 100644 --- a/src/prelude/prim.mo +++ b/src/prelude/prim.mo @@ -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