diff options
| author | Jessica Clarke <jrtc27@jrtc27.com> | 2025-07-30 17:10:45 +0100 |
|---|---|---|
| committer | Jessica Clarke <jrtc27@jrtc27.com> | 2025-07-30 17:10:45 +0100 |
| commit | 3e93964b896023b1006d3c878effb68203d4d8dd (patch) | |
| tree | 3f03bb1729e07cce41f0c46947ba94f877b97b41 /llvm/lib/FileCheck/FileCheck.cpp | |
| parent | 9da811368f7e9ab07bc9aa360eebca7f2ebcd53e (diff) | |
| parent | 52ddcfd8d6c078b3e5ae3c230eea67a466d64f0f (diff) | |
[𝘀𝗽𝗿] changes introduced through rebaseusers/jrtc27/spr/main.nfcielfmips-refactor-mipsgotsection-to-avoid-explicit-writes
Created using spr 1.3.5
[skip ci]
Diffstat (limited to 'llvm/lib/FileCheck/FileCheck.cpp')
| -rw-r--r-- | llvm/lib/FileCheck/FileCheck.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/llvm/lib/FileCheck/FileCheck.cpp b/llvm/lib/FileCheck/FileCheck.cpp index b79f6ec5b4f0..ce35a5bad761 100644 --- a/llvm/lib/FileCheck/FileCheck.cpp +++ b/llvm/lib/FileCheck/FileCheck.cpp @@ -1360,6 +1360,12 @@ void Pattern::printFuzzyMatch(const SourceMgr &SM, StringRef Buffer, size_t Best = StringRef::npos; double BestQuality = 0; + // Arbitrarily limit quadratic search behavior stemming from long CHECK lines. + if (size_t(4096) * size_t(2048) < + std::min(size_t(4096), Buffer.size()) * + std::max(FixedStr.size(), RegExStr.size())) + return; + // Use an arbitrary 4k limit on how far we will search. for (size_t i = 0, e = std::min(size_t(4096), Buffer.size()); i != e; ++i) { if (Buffer[i] == '\n') |
