diff options
author | Ted Kremenek <kremenek@apple.com> | 2010-02-11 05:28:37 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2010-02-11 05:28:37 +0000 |
commit | 3d2c43e9a7ca55f5ddc1f0c77d8f5e5ea7c1b573 (patch) | |
tree | 2a022e8d79470cd5cc683017926f6eeb9167c7c8 /lib/Frontend/PCHReaderDecl.cpp | |
parent | 64952508c2b0c8bffb45c8b410f0af3d2457f59b (diff) |
Remove use of 'std::string' from Attr objects, using instead a byte
array allocated using the allocator in ASTContext. This addresses
these strings getting leaked when using a BumpPtrAllocator (in
ASTContext).
Fixes: <rdar://problem/7636765>
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95853 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Frontend/PCHReaderDecl.cpp')
-rw-r--r-- | lib/Frontend/PCHReaderDecl.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/Frontend/PCHReaderDecl.cpp b/lib/Frontend/PCHReaderDecl.cpp index 43f0b2c5cd..29f5556b19 100644 --- a/lib/Frontend/PCHReaderDecl.cpp +++ b/lib/Frontend/PCHReaderDecl.cpp @@ -446,7 +446,7 @@ Attr *PCHReader::ReadAttributes() { #define STRING_ATTR(Name) \ case Attr::Name: \ - New = ::new (*Context) Name##Attr(ReadString(Record, Idx)); \ + New = ::new (*Context) Name##Attr(*Context, ReadString(Record, Idx)); \ break #define UNSIGNED_ATTR(Name) \ @@ -497,7 +497,7 @@ Attr *PCHReader::ReadAttributes() { std::string Type = ReadString(Record, Idx); unsigned FormatIdx = Record[Idx++]; unsigned FirstArg = Record[Idx++]; - New = ::new (*Context) FormatAttr(Type, FormatIdx, FirstArg); + New = ::new (*Context) FormatAttr(*Context, Type, FormatIdx, FirstArg); break; } |