[libclang] When caching code-completion results, pass the CachedCompletionAllocator
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>
Fri, 16 Nov 2012 03:34:57 +0000 (03:34 +0000)
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>
Fri, 16 Nov 2012 03:34:57 +0000 (03:34 +0000)
commit2bafa0076d8cf99cde2e18478b045efa5158e503
tree8938d9d47092ea4c33a8bfa322ced3d2803203bd
parent0e551c191cab5a3b78a6324f09905052a8f86c51
[libclang] When caching code-completion results, pass the CachedCompletionAllocator
to the CodeCompletionTUInfo that is going to be used to get the results.

Previously we would use ASTUnit's CodeCompletionTUInfo which has its own allocator
that will go away when we reparse. That could result in a use-after-free bug when
getting the parent context name from a CodeCompletionString.

Addresses rdar://12568377.

llvm-svn: 168133
clang/lib/Frontend/ASTUnit.cpp