diff options
author | Michael J. Spencer <bigcheesegs@gmail.com> | 2013-02-07 18:26:45 +0000 |
---|---|---|
committer | Michael J. Spencer <bigcheesegs@gmail.com> | 2013-02-07 18:26:45 +0000 |
commit | def0c1f756562601829364e3fca4bd1f0407316e (patch) | |
tree | eb1d5cf469e8b9ddfeaabedeb89d96fdc9a8523c /include/llvm | |
parent | 64dca86fb4312669086ea8d2df1a13da76b54258 (diff) | |
download | external_llvm-def0c1f756562601829364e3fca4bd1f0407316e.zip external_llvm-def0c1f756562601829364e3fca4bd1f0407316e.tar.gz external_llvm-def0c1f756562601829364e3fca4bd1f0407316e.tar.bz2 |
[Object][ELF] Fix crash on no dynamic section.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174639 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm')
-rw-r--r-- | include/llvm/Object/ELF.h | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/include/llvm/Object/ELF.h b/include/llvm/Object/ELF.h index a844610..4a5eebf 100644 --- a/include/llvm/Object/ELF.h +++ b/include/llvm/Object/ELF.h @@ -513,6 +513,8 @@ public: return Tmp; } + const char *get() const { return Current; } + private: const uint64_t EntitySize; const char *Current; @@ -2292,7 +2294,7 @@ library_iterator ELFObjectFile<ELFT>::begin_libraries_needed() const { } DataRefImpl DRI; - DRI.p = reinterpret_cast<uintptr_t>(&*i); + DRI.p = reinterpret_cast<uintptr_t>(i.get()); return library_iterator(LibraryRef(DRI, this)); } @@ -2312,7 +2314,7 @@ error_code ELFObjectFile<ELFT>::getLibraryNext(DataRefImpl Data, ; DataRefImpl DRI; - DRI.p = reinterpret_cast<uintptr_t>(&*i); + DRI.p = reinterpret_cast<uintptr_t>(i.get()); Result = LibraryRef(DRI, this); return object_error::success; } @@ -2343,7 +2345,7 @@ template<class ELFT> library_iterator ELFObjectFile<ELFT>::end_libraries_needed() const { dyn_iterator e = end_dynamic_table(); DataRefImpl DRI; - DRI.p = reinterpret_cast<uintptr_t>(&*e); + DRI.p = reinterpret_cast<uintptr_t>(e.get()); return library_iterator(LibraryRef(DRI, this)); } |