File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -158,6 +158,11 @@ pm_regexp_parse_range_quantifier(pm_regexp_parser_t *parser) {
158158 } state = PM_REGEXP_RANGE_QUANTIFIER_STATE_START ;
159159
160160 while (1 ) {
161+ if (parser -> cursor >= parser -> end ) {
162+ parser -> cursor = savepoint ;
163+ return true;
164+ }
165+
161166 switch (state ) {
162167 case PM_REGEXP_RANGE_QUANTIFIER_STATE_START :
163168 switch (* parser -> cursor ) {
Original file line number Diff line number Diff line change @@ -186,6 +186,10 @@ def test_fake_range_quantifier_because_of_spaces
186186 assert_valid_regexp ( "foo{1, 2}" )
187187 end
188188
189+ def test_fake_range_quantifier_because_unclosed
190+ assert_valid_regexp ( "\\ A{" )
191+ end
192+
189193 ############################################################################
190194 # These test that flag values are correct.
191195 ############################################################################
You can’t perform that action at this time.
0 commit comments