Skip to content

Commit

Permalink
Fix UB in argument.rs
Browse files Browse the repository at this point in the history
  • Loading branch information
madsmtm committed Sep 1, 2022
1 parent bd27144 commit fb46081
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/argument.rs
Original file line number Diff line number Diff line change
Expand Up @@ -152,11 +152,11 @@ impl StructMemberRef {
unsafe { msg_send![self, dataType] }
}

pub fn struct_type(&self) -> MTLStructType {
pub fn struct_type(&self) -> &StructTypeRef {
unsafe { msg_send![self, structType] }
}

pub fn array_type(&self) -> MTLArrayType {
pub fn array_type(&self) -> &ArrayTypeRef {
unsafe { msg_send![self, arrayType] }
}
}
Expand Down Expand Up @@ -220,11 +220,11 @@ impl ArrayTypeRef {
unsafe { msg_send![self, elementType] }
}

pub fn element_struct_type(&self) -> MTLStructType {
pub fn element_struct_type(&self) -> &StructTypeRef {
unsafe { msg_send![self, elementStructType] }
}

pub fn element_array_type(&self) -> MTLArrayType {
pub fn element_array_type(&self) -> &ArrayTypeRef {
unsafe { msg_send![self, elementArrayType] }
}
}
Expand Down

0 comments on commit fb46081

Please sign in to comment.