[PATCH] D23540: COFF: Fix short import lib import name type bitshift

Martell Malone via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 15 21:20:33 PDT 2016


martell created this revision.
martell added reviewers: ruiu, compnerd.
martell added a subscriber: llvm-commits.
martell set the repository for this revision to rL LLVM.

As per the PE COFF spec (section 8.3, Import Name Type)

Offset: 18  Size 2 bits Name: Type
Offset: 20  Size 3 bits Name: Name Type

Offset: 20  added based on 18+2


Repository:
  rL LLVM

https://reviews.llvm.org/D23540

Files:
  include/llvm/Support/COFF.h

Index: include/llvm/Support/COFF.h
===================================================================
--- include/llvm/Support/COFF.h
+++ include/llvm/Support/COFF.h
@@ -657,7 +657,7 @@
     }

     ImportNameType getNameType() const {
-      return static_cast<ImportNameType>((TypeInfo & 0x1C) >> 3);
+      return static_cast<ImportNameType>((TypeInfo & 0x1C) >> 2);
     }
   };



-------------- next part --------------
A non-text attachment was scrubbed...
Name: D23540.68129.patch
Type: text/x-patch
Size: 385 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160816/a3708cfc/attachment.bin>


More information about the llvm-commits mailing list