summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen
diff options
context:
space:
mode:
authorReid Kleckner <reid@kleckner.net>2014-05-02 00:05:16 +0000
committerReid Kleckner <reid@kleckner.net>2014-05-02 00:05:16 +0000
commit34a38d8efbde085814bbbb5d1d7c7fcb15897e42 (patch)
treed36d637ebb49ba943e12b8551ce90764a3caf648 /clang/lib/CodeGen
parentd9070c5ee77c5429b7f84df965df4206045c3504 (diff)
downloadbcm5719-llvm-34a38d8efbde085814bbbb5d1d7c7fcb15897e42.tar.gz
bcm5719-llvm-34a38d8efbde085814bbbb5d1d7c7fcb15897e42.zip
MS ABI: Fix logic bug in member pointer null test code
This code is trying to test if the pointer is *not* null. Therefore we should use 'or' instead of 'and' to combine the results of 'icmp ne'. This logic is consistent with the general member pointer comparison code in EmitMemberPointerComparison. llvm-svn: 207815
Diffstat (limited to 'clang/lib/CodeGen')
-rw-r--r--clang/lib/CodeGen/MicrosoftCXXABI.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/MicrosoftCXXABI.cpp b/clang/lib/CodeGen/MicrosoftCXXABI.cpp
index 528cdf6238e..869734ab4e4 100644
--- a/clang/lib/CodeGen/MicrosoftCXXABI.cpp
+++ b/clang/lib/CodeGen/MicrosoftCXXABI.cpp
@@ -1628,7 +1628,7 @@ MicrosoftCXXABI::EmitMemberPointerIsNotNull(CodeGenFunction &CGF,
for (int I = 1, E = fields.size(); I < E; ++I) {
llvm::Value *Field = Builder.CreateExtractValue(MemPtr, I);
llvm::Value *Next = Builder.CreateICmpNE(Field, fields[I], "memptr.cmp");
- Res = Builder.CreateAnd(Res, Next, "memptr.tobool");
+ Res = Builder.CreateOr(Res, Next, "memptr.tobool");
}
return Res;
}
OpenPOWER on IntegriCloud