owenpan created this revision. owenpan added reviewers: curdeius, HazardyKnusperkeks, MyDeveloperDay. owenpan added a project: clang-format. Herald added a project: All. owenpan requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits.
Fixes https://github.com/llvm/llvm-project/issues/56043. Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D128574 Files: clang/lib/Format/UnwrappedLineFormatter.cpp Index: clang/lib/Format/UnwrappedLineFormatter.cpp =================================================================== --- clang/lib/Format/UnwrappedLineFormatter.cpp +++ clang/lib/Format/UnwrappedLineFormatter.cpp @@ -1163,6 +1163,10 @@ // While not empty, take first element and follow edges. while (!Queue.empty()) { + // Quit if we still haven't found a solution by now. + if (Count > 25000000) + return 0; + Penalty = Queue.top().first.first; StateNode *Node = Queue.top().second; if (!Node->State.NextToken) {
Index: clang/lib/Format/UnwrappedLineFormatter.cpp =================================================================== --- clang/lib/Format/UnwrappedLineFormatter.cpp +++ clang/lib/Format/UnwrappedLineFormatter.cpp @@ -1163,6 +1163,10 @@ // While not empty, take first element and follow edges. while (!Queue.empty()) { + // Quit if we still haven't found a solution by now. + if (Count > 25000000) + return 0; + Penalty = Queue.top().first.first; StateNode *Node = Queue.top().second; if (!Node->State.NextToken) {
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits