Fix Module.link_in so it reports error and destory the other module when preserve=False

This commit is contained in:
Siu Kwan Lam 2013-01-10 16:52:25 -06:00
commit ee62b0c96c
2 changed files with 9 additions and 6 deletions

View file

@ -280,7 +280,7 @@ _wLLVMLinkModules(PyObject *self, PyObject *args)
PyObject *ret;
char *errmsg;
if (!LLVMLinkModules(dest, src, (LLVMLinkerMode)mode, &errmsg)) {
if (LLVMLinkModules(dest, src, (LLVMLinkerMode)mode, &errmsg)) {
if (errmsg) {
ret = PyUnicode_FromString(errmsg);
LLVMDisposeMessage(errmsg);