From f782d9c7002edaaf56c06a6cc1775f8f67713a29 Mon Sep 17 00:00:00 2001 From: Sam McCall Date: Wed, 15 Jul 2020 11:03:11 +0200 Subject: [PATCH] [clangd] Fix use-after-free in ArgStripper --- clang-tools-extra/clangd/CompileCommands.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/clang-tools-extra/clangd/CompileCommands.h b/clang-tools-extra/clangd/CompileCommands.h index 84c4c2a26a87..3efd80026cf6 100644 --- a/clang-tools-extra/clangd/CompileCommands.h +++ b/clang-tools-extra/clangd/CompileCommands.h @@ -12,6 +12,7 @@ #include "clang/Tooling/ArgumentsAdjusters.h" #include "clang/Tooling/CompilationDatabase.h" #include "llvm/ADT/StringMap.h" +#include #include #include @@ -92,7 +93,7 @@ private: const Rule *matchingRule(llvm::StringRef Arg, unsigned Mode, unsigned &ArgCount) const; llvm::SmallVector Rules; - std::vector Storage; // Store strings not found in option table. + std::deque Storage; // Store strings not found in option table. }; } // namespace clangd