1
Fork 0

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
This commit is contained in:
Alex Crichton 2014-04-15 07:25:22 -07:00
parent bb580f1a56
commit de7845ac72
4 changed files with 27 additions and 17 deletions

View file

@ -68,4 +68,4 @@
#include <unistd.h>
#endif
extern const char* LLVMRustError;
void LLVMRustSetLastError(const char*);