summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST
diff options
context:
space:
mode:
authorJames Y Knight <jyknight@google.com>2015-12-31 06:01:19 +0000
committerJames Y Knight <jyknight@google.com>2015-12-31 06:01:19 +0000
commitdb8cdd35b6cd277fa8ca2f2cc7057603fbc6a302 (patch)
tree4834f48db46f5dc41120ba768ac348c3fe5607c5 /clang/lib/AST
parent822b4f20e0a8a8c9fa4198d05e5ee0778616112a (diff)
downloadbcm5719-llvm-db8cdd35b6cd277fa8ca2f2cc7057603fbc6a302.tar.gz
bcm5719-llvm-db8cdd35b6cd277fa8ca2f2cc7057603fbc6a302.zip
[TrailingObjects] Fix bug in "Convert classes in ExprObjC.h"
(Detected by asan) llvm-svn: 256665
Diffstat (limited to 'clang/lib/AST')
-rw-r--r--clang/lib/AST/ExprObjC.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/clang/lib/AST/ExprObjC.cpp b/clang/lib/AST/ExprObjC.cpp
index 0b6bfcd6006..0936a81a597 100644
--- a/clang/lib/AST/ExprObjC.cpp
+++ b/clang/lib/AST/ExprObjC.cpp
@@ -59,7 +59,8 @@ ObjCDictionaryLiteral::ObjCDictionaryLiteral(ArrayRef<ObjCDictionaryElement> VK,
NumElements(VK.size()), HasPackExpansions(HasPackExpansions), Range(SR),
DictWithObjectsMethod(method) {
KeyValuePair *KeyValues = getTrailingObjects<KeyValuePair>();
- ExpansionData *Expansions = getTrailingObjects<ExpansionData>();
+ ExpansionData *Expansions =
+ HasPackExpansions ? getTrailingObjects<ExpansionData>() : nullptr;
for (unsigned I = 0; I < NumElements; I++) {
if (VK[I].Key->isTypeDependent() || VK[I].Key->isValueDependent() ||
VK[I].Value->isTypeDependent() || VK[I].Value->isValueDependent())
OpenPOWER on IntegriCloud