From e442fe3db916682840279e08a627cdf8b290fe74 Mon Sep 17 00:00:00 2001 From: Douglas Gregor Date: Mon, 10 Oct 2011 23:37:54 +0000 Subject: [PATCH] Make sure we initialize the "extra" data within the libclang code completion context, in case we end up having no code-completion callback. Individual instances of this problem are always bugs that need to be fixed, but it's better to make sure we have initialized data here. llvm-svn: 141598 --- clang/tools/libclang/CIndexCodeCompletion.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/clang/tools/libclang/CIndexCodeCompletion.cpp b/clang/tools/libclang/CIndexCodeCompletion.cpp index b419fd6850eb..3ce0d245cf3f 100644 --- a/clang/tools/libclang/CIndexCodeCompletion.cpp +++ b/clang/tools/libclang/CIndexCodeCompletion.cpp @@ -274,7 +274,12 @@ AllocatedCXCodeCompleteResults::AllocatedCXCodeCompleteResults( llvm::IntrusiveRefCntPtr(new DiagnosticIDs))), FileSystemOpts(FileSystemOpts), FileMgr(new FileManager(FileSystemOpts)), - SourceMgr(new SourceManager(*Diag, *FileMgr)) { + SourceMgr(new SourceManager(*Diag, *FileMgr)), + Contexts(CXCompletionContext_Unknown), + ContainerKind(CXCursor_InvalidCode), + ContainerUSR(createCXString("")), + ContainerIsIncomplete(1) +{ if (getenv("LIBCLANG_OBJTRACKING")) { llvm::sys::AtomicIncrement(&CodeCompletionResultObjects); fprintf(stderr, "+++ %d completion results\n", CodeCompletionResultObjects); -- GitLab