TheButlah commented on code in PR #278:
URL: 
https://github.com/apache/teaclave-trustzone-sdk/pull/278#discussion_r2784866405


##########
optee-utee/src/parameter.rs:
##########
@@ -127,9 +246,11 @@ impl Parameter {
         match self.param_type {
             ParamType::MemrefInout | ParamType::MemrefInput | 
ParamType::MemrefOutput => {
                 Ok(ParamMemref {
-                    raw: &mut (*self.raw).memref,
+                    raw: 
NonNull::new_unchecked(addr_of_mut!((*self.raw).memref)),
                     param_type: self.param_type,
-                    _marker: marker::PhantomData,
+                    capacity: unsafe { *self.raw }.memref.size,

Review Comment:
   Done. BTW I would consider this to be an anti-pattern. 2024 edition turns on 
warnings by default if the `unsafe` keyword is not used explicitly. It might be 
good for teaclave to `#![forbid(unsafe_op_in_unsafe_fn)]` by default.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to