]> git.lizzy.rs Git - rust.git/commit
rustc: Fix passing errors from LLVM to rustc
authorAlex Crichton <alex@alexcrichton.com>
Tue, 15 Apr 2014 14:25:22 +0000 (07:25 -0700)
committerAlex Crichton <alex@alexcrichton.com>
Wed, 23 Apr 2014 17:04:29 +0000 (10:04 -0700)
commitde7845ac72e01b491b4ed352f23c2c9a73efc45b
tree1b834db9811246cc36ac73f64a0584ac07702019
parentbb580f1a56138bd5a96ccc95c0f61caab72cf975
rustc: Fix passing errors from LLVM to rustc

Many of the instances of setting a global error variable ended up leaving a
dangling pointer into free'd memory. This changes the method of error
transmission to strdup any error and "relinquish ownership" to rustc when it
gets an error. The corresponding Rust code will then free the error as
necessary.

Closes #12865
src/librustc/back/link.rs
src/rustllvm/PassWrapper.cpp
src/rustllvm/RustWrapper.cpp
src/rustllvm/rustllvm.h