]> git.proxmox.com Git - perlmod.git/commitdiff
macro: pass 'cv' as Value
authorWolfgang Bumiller <w.bumiller@proxmox.com>
Fri, 7 Jan 2022 14:59:07 +0000 (15:59 +0100)
committerWolfgang Bumiller <w.bumiller@proxmox.com>
Fri, 7 Jan 2022 14:59:33 +0000 (15:59 +0100)
to reduce the amount of required unsafe blocks

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
perlmod-macro/src/function.rs

index 7281aba1c6a2832a77a37ae658d2d8aa864768de..8f72c5bb4e956cc899c71d9d324e7ee4b71a3f25 100644 (file)
@@ -320,7 +320,10 @@ fn handle_return_kind(
     };
 
     let (cv_arg_name, cv_arg_passed) = if cv_arg {
-        (quote! { cv }, quote! { cv })
+        (
+            quote! { cv },
+            quote! { ::perlmod::Value::from_raw_ref(cv as *mut ::perlmod::ffi::SV) },
+        )
     } else {
         (quote! { _cv }, TokenStream::new())
     };