]> granicus.if.org Git - llvm/commitdiff
[COFF] Fix delay import directory iterator
authorJoseph Tremoulet <jotrem@microsoft.com>
Thu, 4 Apr 2019 14:13:28 +0000 (14:13 +0000)
committerJoseph Tremoulet <jotrem@microsoft.com>
Thu, 4 Apr 2019 14:13:28 +0000 (14:13 +0000)
Summary:
Take the Index into account in `getDelayImportTable`, otherwise we
always return the entry for the first delay DLL reference.

Reviewers: ruiu

Reviewed By: ruiu

Subscribers: hiraditya, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D60081

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357697 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Object/COFFObjectFile.cpp

index 7839c65516b4d70d1879a7f2fcc4129e03e4637e..d52206d8cd36a5f8edcd739f7b486f5f7efa604a 100644 (file)
@@ -1457,7 +1457,7 @@ std::error_code DelayImportDirectoryEntryRef::getName(StringRef &Result) const {
 
 std::error_code DelayImportDirectoryEntryRef::
 getDelayImportTable(const delay_import_directory_table_entry *&Result) const {
-  Result = Table;
+  Result = &Table[Index];
   return std::error_code();
 }