From ca6773808f8e75ffa86847e9d12885c69e9de53e Mon Sep 17 00:00:00 2001 From: John McCall Date: Sun, 16 May 2010 02:12:01 +0000 Subject: [PATCH] Be sure to initialize the "has base type as written" field of an ObjCObjectTypeLoc. This should clear up some valgrind errors we've been seeing. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103894 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/clang/AST/TypeLoc.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/include/clang/AST/TypeLoc.h b/include/clang/AST/TypeLoc.h index 4896fe948b..ae478c8c8d 100644 --- a/include/clang/AST/TypeLoc.h +++ b/include/clang/AST/TypeLoc.h @@ -559,7 +559,7 @@ class SubstTemplateTypeParmTypeLoc : struct ObjCProtocolListLocInfo { SourceLocation LAngleLoc; SourceLocation RAngleLoc; - bool HasBaseType; + bool HasBaseTypeAsWritten; }; // A helper class for defining ObjC TypeLocs that can qualified with @@ -610,11 +610,11 @@ public: } bool hasBaseTypeAsWritten() const { - return getLocalData()->HasBaseType; + return getLocalData()->HasBaseTypeAsWritten; } void setHasBaseTypeAsWritten(bool HasBaseType) { - getLocalData()->HasBaseType = HasBaseType; + getLocalData()->HasBaseTypeAsWritten = HasBaseType; } TypeLoc getBaseLoc() const { @@ -626,6 +626,7 @@ public: } void initializeLocal(SourceLocation Loc) { + setHasBaseTypeAsWritten(true); setLAngleLoc(Loc); setRAngleLoc(Loc); for (unsigned i = 0, e = getNumProtocols(); i != e; ++i) -- 2.50.0