diff options
| author | Chris Lattner <sabre@nondot.org> | 2008-03-12 00:50:01 +0000 | 
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2008-03-12 00:50:01 +0000 | 
| commit | 1f49988a7afc697828fc318daeed8f287bdeca69 (patch) | |
| tree | 995c6829f89cd832722ab586acb4c63fb4d0f7d8 /llvm/lib | |
| parent | 0d98256c05bfcb3b1d5629fab9bc174dd03e82af (diff) | |
| download | bcm5719-llvm-1f49988a7afc697828fc318daeed8f287bdeca69.tar.gz bcm5719-llvm-1f49988a7afc697828fc318daeed8f287bdeca69.zip  | |
This is a simple fix for getting error messages from dlerror in
LoadLibraryPermanently. The current code modifies the value of a pointer
that is passed by value, so the caller never gets the message.
Patch by Julien Lerouge!
llvm-svn: 48270
Diffstat (limited to 'llvm/lib')
| -rw-r--r-- | llvm/lib/System/DynamicLibrary.cpp | 3 | 
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/System/DynamicLibrary.cpp b/llvm/lib/System/DynamicLibrary.cpp index 9c52c8a18cd..bdbcbd406fd 100644 --- a/llvm/lib/System/DynamicLibrary.cpp +++ b/llvm/lib/System/DynamicLibrary.cpp @@ -63,7 +63,8 @@ bool DynamicLibrary::LoadLibraryPermanently(const char *Filename,                                              std::string *ErrMsg) {    void *H = dlopen(Filename, RTLD_LAZY);    if (H == 0) { -    ErrMsg = new std::string(dlerror()); +    if (ErrMsg) +      *ErrMsg = dlerror();      return true;    }    OpenedHandles.push_back(H);  | 

