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:
@@ -68,4 +68,4 @@
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
extern const char* LLVMRustError;
|
||||
void LLVMRustSetLastError(const char*);
|
||||
|
||||
Reference in New Issue
Block a user