]> git.tdb.fi Git - libs/core.git/commitdiff
Don't access iterator if it's at end
authorMikko Rasa <tdb@tdb.fi>
Wed, 1 Sep 2021 00:13:05 +0000 (03:13 +0300)
committerMikko Rasa <tdb@tdb.fi>
Wed, 1 Sep 2021 00:13:05 +0000 (03:13 +0300)
source/strings/regex.cpp

index 832cd85b110ac81d245af918375ddd24256727ef..c62405614525dd85b32a73361bd78133e03ef29f 100644 (file)
@@ -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<repeat_min; ++j)
                                result += atom;