File tree Expand file tree Collapse file tree 2 files changed +6
-2
lines changed
include/rapidjson/internal Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -395,8 +395,7 @@ class GenericRegex {
395
395
}
396
396
return false ;
397
397
398
- default :
399
- RAPIDJSON_ASSERT (op == kOneOrMore );
398
+ case kOneOrMore :
400
399
if (operandStack.GetSize () >= sizeof (Frag)) {
401
400
Frag e = *operandStack.template Pop <Frag>(1 );
402
401
SizeType s = NewState (kRegexInvalidState , e.start , 0 );
@@ -405,6 +404,10 @@ class GenericRegex {
405
404
return true ;
406
405
}
407
406
return false ;
407
+
408
+ default :
409
+ // syntax error (e.g. unclosed kLeftParenthesis)
410
+ return false ;
408
411
}
409
412
}
410
413
Original file line number Diff line number Diff line change @@ -595,6 +595,7 @@ TEST(Regex, Invalid) {
595
595
TEST_INVALID (" " );
596
596
TEST_INVALID (" a|" );
597
597
TEST_INVALID (" ()" );
598
+ TEST_INVALID (" (" );
598
599
TEST_INVALID (" )" );
599
600
TEST_INVALID (" (a))" );
600
601
TEST_INVALID (" (a|)" );
You can’t perform that action at this time.
0 commit comments