From: James Y Knight Date: Thu, 31 Dec 2015 06:01:19 +0000 (+0000) Subject: [TrailingObjects] Fix bug in "Convert classes in ExprObjC.h" X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b94552b8004090fc86f3a51c161520c31518a164;p=clang [TrailingObjects] Fix bug in "Convert classes in ExprObjC.h" (Detected by asan) git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@256665 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/AST/ExprObjC.cpp b/lib/AST/ExprObjC.cpp index 0b6bfcd600..0936a81a59 100644 --- a/lib/AST/ExprObjC.cpp +++ b/lib/AST/ExprObjC.cpp @@ -59,7 +59,8 @@ ObjCDictionaryLiteral::ObjCDictionaryLiteral(ArrayRef VK, NumElements(VK.size()), HasPackExpansions(HasPackExpansions), Range(SR), DictWithObjectsMethod(method) { KeyValuePair *KeyValues = getTrailingObjects(); - ExpansionData *Expansions = getTrailingObjects(); + ExpansionData *Expansions = + HasPackExpansions ? getTrailingObjects() : 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())