Report an error if one occurs in releaseModule.

llvm-svn: 40405
This commit is contained in:
Reid Spencer 2007-07-22 21:39:37 +00:00
parent 06bdb78751
commit dd93d5abaa

View File

@ -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<Module> AutoModule((*I)->releaseModule( &moduleErrorMsg ));
if (!moduleErrorMsg.empty())
return error("Could not load a module: " + moduleErrorMsg);
Module* aModule = AutoModule.get();
if (aModule != NULL) {