From 985e33a768ebbe3316dc9db8cb580bfdcb9ec0d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Botond=20D=C3=A9nes?= Date: Thu, 6 Apr 2023 07:36:25 -0400 Subject: [PATCH] utils: s/std::regex/boost::regex/ The former is prone to producing stack-overflow as it uses recursion in it match implementation. The migration is entirely mechanical. --- utils/config_file_impl.hh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/utils/config_file_impl.hh b/utils/config_file_impl.hh index d3fab1a435..3b15ecde01 100644 --- a/utils/config_file_impl.hh +++ b/utils/config_file_impl.hh @@ -10,7 +10,7 @@ #pragma once #include -#include +#include #include #include @@ -107,11 +107,11 @@ void validate(boost::any& out, const std::vector& in, std::unordere out = boost::any(map_type()); } - static const std::regex key(R"foo((?:^|\:)([^=:]+)=)foo"); + static const boost::regex key(R"foo((?:^|\:)([^=:]+)=)foo"); auto* p = boost::any_cast(&out); for (const auto& s : in) { - std::sregex_iterator i(s.begin(), s.end(), key), e; + boost::sregex_iterator i(s.begin(), s.end(), key), e; if (i == e) { throw boost::program_options::invalid_option_value(s);