[PATCH] D131017: Fix use-after-free in clang-apply-replacements
Ben Langmuir via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Tue Aug 2 13:31:43 PDT 2022
benlangmuir created this revision.
benlangmuir added reviewers: bnbarham, fmayer.
Herald added a project: All.
benlangmuir requested review of this revision.
Herald added a project: clang-tools-extra.
Herald added a subscriber: cfe-commits.
Accidentally introduced a dangling StringRef in b4c6dc2e6637 <https://reviews.llvm.org/rGb4c6dc2e66370d94ff52075c2710a674d8e1e0f8>.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D131017
Files:
clang-tools-extra/clang-apply-replacements/lib/Tooling/ApplyReplacements.cpp
Index: clang-tools-extra/clang-apply-replacements/lib/Tooling/ApplyReplacements.cpp
===================================================================
--- clang-tools-extra/clang-apply-replacements/lib/Tooling/ApplyReplacements.cpp
+++ clang-tools-extra/clang-apply-replacements/lib/Tooling/ApplyReplacements.cpp
@@ -24,6 +24,7 @@
#include "clang/Tooling/ReplacementsYaml.h"
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/Optional.h"
+#include "llvm/ADT/StringSet.h"
#include "llvm/Support/FileSystem.h"
#include "llvm/Support/MemoryBuffer.h"
#include "llvm/Support/Path.h"
@@ -140,7 +141,7 @@
static llvm::DenseMap<const FileEntry *, std::vector<tooling::Replacement>>
groupReplacements(const TUReplacements &TUs, const TUDiagnostics &TUDs,
const clang::SourceManager &SM) {
- std::set<StringRef> Warned;
+ llvm::StringSet<> Warned;
llvm::DenseMap<const FileEntry *, std::vector<tooling::Replacement>>
GroupedReplacements;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D131017.449406.patch
Type: text/x-patch
Size: 969 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20220802/7bf1e25b/attachment.bin>
More information about the cfe-commits
mailing list