[llvm] r241703 - Object/COFF: Fix import library's getNameType method.

Rui Ueyama ruiu at google.com
Wed Jul 8 11:21:09 PDT 2015


Author: ruiu
Date: Wed Jul  8 13:21:09 2015
New Revision: 241703

URL: http://llvm.org/viewvc/llvm-project?rev=241703&view=rev
Log:
Object/COFF: Fix import library's getNameType method.

This expression to extract bits were simply wrong.
I'm going to test this functionality from LLD.


Modified:
    llvm/trunk/include/llvm/Object/COFF.h

Modified: llvm/trunk/include/llvm/Object/COFF.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Object/COFF.h?rev=241703&r1=241702&r2=241703&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Object/COFF.h (original)
+++ llvm/trunk/include/llvm/Object/COFF.h Wed Jul  8 13:21:09 2015
@@ -474,7 +474,7 @@ struct coff_import_header {
   support::ulittle16_t OrdinalHint;
   support::ulittle16_t TypeInfo;
   int getType() const { return TypeInfo & 0x3; }
-  int getNameType() const { return (TypeInfo & 0x7) >> 2; }
+  int getNameType() const { return (TypeInfo >> 2) & 0x7; }
 };
 
 struct coff_import_directory_table_entry {





More information about the llvm-commits mailing list