From e33e7e7a5a3640938609dea13788c8f8750e36a4 Mon Sep 17 00:00:00 2001 From: Matt Liberty Date: Wed, 15 May 2024 08:53:03 -0700 Subject: [PATCH] gui: switch to boost regex for long src line The STL regex matcher apparently uses recursion and dies on a longer match. Boost does not appear to have this problem so we use it for the srcs line in the rpt file which can be long. Signed-off-by: Matt Liberty --- src/gui/src/drcWidget.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/gui/src/drcWidget.cpp b/src/gui/src/drcWidget.cpp index 3cffe83f4fa..3154143dab5 100644 --- a/src/gui/src/drcWidget.cpp +++ b/src/gui/src/drcWidget.cpp @@ -41,6 +41,7 @@ #include #include #include +#include #include #include #include @@ -521,7 +522,7 @@ void DRCWidget::loadTRReport(const QString& filename) } std::regex violation_type("\\s*violation type: (.*)"); - std::regex srcs("\\s*srcs: (.*)"); + boost::regex srcs("\\s*srcs: (.*)"); std::regex congestion_line("\\s*congestion information: (.*)"); std::regex bbox_layer("\\s*bbox = (.*) on Layer (.*)"); std::regex bbox_corners( @@ -557,8 +558,9 @@ void DRCWidget::loadTRReport(const QString& filename) int source_line_number = line_number; std::getline(report, line); std::string sources; - if (std::regex_match(line, base_match, srcs)) { - sources = base_match[1].str(); + boost::smatch sources_match; + if (boost::regex_match(line, sources_match, srcs)) { + sources = sources_match[1].str(); } else { logger_->error(utl::GUI, 46,