From c2530205a67e5d0b341827287151978652b91aaa Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Wed, 1 Sep 2021 03:13:05 +0300 Subject: [PATCH] Don't access iterator if it's at end --- source/strings/regex.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/source/strings/regex.cpp b/source/strings/regex.cpp index 832cd85..c624056 100644 --- a/source/strings/regex.cpp +++ b/source/strings/regex.cpp @@ -130,7 +130,8 @@ Regex::Code Regex::compile(const string &expr, string::const_iterator &iter, uns Count repeat_min = 1; Count repeat_max = 1; - parse_repeat(expr, i, repeat_min, repeat_max); + if(i!=end) + parse_repeat(expr, i, repeat_min, repeat_max); for(unsigned j=0; j