File tree Expand file tree Collapse file tree 2 files changed +9
-0
lines changed Expand file tree Collapse file tree 2 files changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -158,6 +158,11 @@ pm_regexp_parse_range_quantifier(pm_regexp_parser_t *parser) {
158
158
} state = PM_REGEXP_RANGE_QUANTIFIER_STATE_START ;
159
159
160
160
while (1 ) {
161
+ if (parser -> cursor >= parser -> end ) {
162
+ parser -> cursor = savepoint ;
163
+ return true;
164
+ }
165
+
161
166
switch (state ) {
162
167
case PM_REGEXP_RANGE_QUANTIFIER_STATE_START :
163
168
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
186
186
assert_valid_regexp ( "foo{1, 2}" )
187
187
end
188
188
189
+ def test_fake_range_quantifier_because_unclosed
190
+ assert_valid_regexp ( "\\ A{" )
191
+ end
192
+
189
193
############################################################################
190
194
# These test that flag values are correct.
191
195
############################################################################
You can’t perform that action at this time.
0 commit comments