Skip to content

Commit

Permalink
Dangling pointer fix
Browse files Browse the repository at this point in the history
  • Loading branch information
newpavlov committed Feb 11, 2018
1 parent 7c6adb4 commit c2a31de
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/librustc_trans/llvm_util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,8 @@ pub fn target_features(sess: &Session) -> Vec<Symbol> {
.iter()
.filter(|feature| {
let llvm_feature = to_llvm_feature(feature);
let ptr = CString::new(llvm_feature).unwrap().as_ptr();
unsafe { llvm::LLVMRustHasFeature(target_machine, ptr) }
let cstr = CString::new(llvm_feature).unwrap();
unsafe { llvm::LLVMRustHasFeature(target_machine, cstr.as_ptr()) }
})
.map(|feature| Symbol::intern(feature)).collect()
}
Expand Down

0 comments on commit c2a31de

Please sign in to comment.