[llvm] r226869 - [Object] Fix a bug in a condition introduced in r226217 - visibility can't be

Lang Hames lhames at gmail.com
Thu Jan 22 14:04:47 PST 2015


Author: lhames
Date: Thu Jan 22 16:04:47 2015
New Revision: 226869

URL: http://llvm.org/viewvc/llvm-project?rev=226869&view=rev
Log:
[Object] Fix a bug in a condition introduced in r226217 - visibility can't be
both hidden and default.

Bug found by inspection by Rafael Espindola. No test: As discussed in the commit
message for r226217 we don't have a good way to test this yet.


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

Modified: llvm/trunk/include/llvm/Object/ELFObjectFile.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Object/ELFObjectFile.h?rev=226869&r1=226868&r2=226869&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Object/ELFObjectFile.h (original)
+++ llvm/trunk/include/llvm/Object/ELFObjectFile.h Thu Jan 22 16:04:47 2015
@@ -185,7 +185,7 @@ protected:
     // visibility is either DEFAULT or PROTECTED. All other symbols are not
     // exported.
     if ((Binding == ELF::STB_GLOBAL || Binding == ELF::STB_WEAK) &&
-        (Visibility == ELF::STV_DEFAULT && Visibility == ELF::STV_PROTECTED))
+        (Visibility == ELF::STV_DEFAULT || Visibility == ELF::STV_PROTECTED))
       return true;
 
     return false;





More information about the llvm-commits mailing list