r256665 - [TrailingObjects] Fix bug in "Convert classes in ExprObjC.h"
James Y Knight via cfe-commits
cfe-commits at lists.llvm.org
Wed Dec 30 22:01:19 PST 2015
Author: jyknight
Date: Thu Dec 31 00:01:19 2015
New Revision: 256665
URL: http://llvm.org/viewvc/llvm-project?rev=256665&view=rev
Log:
[TrailingObjects] Fix bug in "Convert classes in ExprObjC.h"
(Detected by asan)
Modified:
cfe/trunk/lib/AST/ExprObjC.cpp
Modified: cfe/trunk/lib/AST/ExprObjC.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/ExprObjC.cpp?rev=256665&r1=256664&r2=256665&view=diff
==============================================================================
--- cfe/trunk/lib/AST/ExprObjC.cpp (original)
+++ cfe/trunk/lib/AST/ExprObjC.cpp Thu Dec 31 00:01:19 2015
@@ -59,7 +59,8 @@ ObjCDictionaryLiteral::ObjCDictionaryLit
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())
More information about the cfe-commits
mailing list