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:
parent
bb580f1a56
commit
de7845ac72
4 changed files with 27 additions and 17 deletions
|
@ -68,4 +68,4 @@
|
|||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
extern const char* LLVMRustError;
|
||||
void LLVMRustSetLastError(const char*);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue