Skip to content

Commit

Permalink
Fix as_ptr() drop problem
Browse files Browse the repository at this point in the history
  • Loading branch information
mattico committed Feb 11, 2017
1 parent 68fff62 commit aebce5b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/librustc_trans/debuginfo/metadata.rs
Original file line number Diff line number Diff line change
Expand Up @@ -787,20 +787,20 @@ pub fn compile_unit_metadata(scc: &SharedCrateContext,
(option_env!("CFG_VERSION")).expect("CFG_VERSION"));

let compile_unit_name = compile_unit_name.as_ptr();
let work_dir = path2cstr(&work_dir).as_ptr();
let producer = CString::new(producer).unwrap().as_ptr();
let work_dir = path2cstr(&work_dir);
let producer = CString::new(producer).unwrap();
let flags = "\0";
let split_name = "\0";

unsafe {
let file_metadata = llvm::LLVMRustDIBuilderCreateFile(
debug_context.builder, compile_unit_name, work_dir);
debug_context.builder, compile_unit_name, work_dir.as_ptr());

return llvm::LLVMRustDIBuilderCreateCompileUnit(
debug_context.builder,
DW_LANG_RUST,
file_metadata,
producer,
producer.as_ptr(),
sess.opts.optimize != config::OptLevel::No,
flags.as_ptr() as *const _,
0,
Expand Down

0 comments on commit aebce5b

Please sign in to comment.