Skip to content

Commit c2a31de

Browse files
authored
Dangling pointer fix
1 parent 7c6adb4 commit c2a31de

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/librustc_trans/llvm_util.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -118,8 +118,8 @@ pub fn target_features(sess: &Session) -> Vec<Symbol> {
118118
.iter()
119119
.filter(|feature| {
120120
let llvm_feature = to_llvm_feature(feature);
121-
let ptr = CString::new(llvm_feature).unwrap().as_ptr();
122-
unsafe { llvm::LLVMRustHasFeature(target_machine, ptr) }
121+
let cstr = CString::new(llvm_feature).unwrap();
122+
unsafe { llvm::LLVMRustHasFeature(target_machine, cstr.as_ptr()) }
123123
})
124124
.map(|feature| Symbol::intern(feature)).collect()
125125
}

0 commit comments

Comments
 (0)