From dd93d5abaa5b18a196cbe9dc3338f1bf1b205a8c Mon Sep 17 00:00:00 2001 From: Reid Spencer Date: Sun, 22 Jul 2007 21:39:37 +0000 Subject: [PATCH] Report an error if one occurs in releaseModule. llvm-svn: 40405 --- lib/Linker/LinkArchives.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/Linker/LinkArchives.cpp b/lib/Linker/LinkArchives.cpp index 381d0e7e5a0..f25df888ff8 100644 --- a/lib/Linker/LinkArchives.cpp +++ b/lib/Linker/LinkArchives.cpp @@ -159,6 +159,9 @@ Linker::LinkInArchive(const sys::Path &Filename, bool &is_native) { // Get the module we must link in. std::string moduleErrorMsg; std::auto_ptr AutoModule((*I)->releaseModule( &moduleErrorMsg )); + if (!moduleErrorMsg.empty()) + return error("Could not load a module: " + moduleErrorMsg); + Module* aModule = AutoModule.get(); if (aModule != NULL) {