File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -109,19 +109,21 @@ impl<'ctx> MetadataValue<'ctx> {
109
109
return Vec :: new ( ) ;
110
110
}
111
111
112
- let count = self . get_node_size ( ) ;
113
- let mut raw_vec: Vec < LLVMValueRef > = Vec :: with_capacity ( count as usize ) ;
112
+ let count = self . get_node_size ( ) as usize ;
113
+ let mut raw_vec: Vec < LLVMValueRef > = Vec :: with_capacity ( count) ;
114
114
let ptr = raw_vec. as_mut_ptr ( ) ;
115
115
116
116
forget ( raw_vec) ;
117
117
118
- let slice = unsafe {
118
+ let vec = unsafe {
119
119
LLVMGetMDNodeOperands ( self . as_value_ref ( ) , ptr) ;
120
120
121
- from_raw_parts ( ptr, count as usize )
121
+ Vec :: from_raw_parts ( ptr, count, count )
122
122
} ;
123
123
124
- slice. iter ( ) . map ( |val| BasicMetadataValueEnum :: new ( * val) ) . collect ( )
124
+ vec. iter ( )
125
+ . map ( |val| BasicMetadataValueEnum :: new ( * val) )
126
+ . collect ( )
125
127
}
126
128
127
129
pub fn print_to_string ( self ) -> LLVMString {
You can’t perform that action at this time.
0 commit comments