@@ -1277,7 +1277,7 @@ if (allow_sign >= 0 && sign != 0)
1277
1277
}
1278
1278
1279
1279
if (sign > 0 ) n += allow_sign ;
1280
- else if (( int ) n > allow_sign )
1280
+ else if (n > ( uint32_t ) allow_sign )
1281
1281
{
1282
1282
* errorcodeptr = ERR15 ; /* Non-existent subpattern */
1283
1283
goto EXIT ;
@@ -3650,10 +3650,12 @@ while (ptr < ptrend)
3650
3650
goto FAILED ;
3651
3651
}
3652
3652
3653
- /* Jump here from '(?[...])'. */
3654
-
3655
3653
class_mode_state = ((options & PCRE2_ALT_EXTENDED_CLASS ) != 0 )?
3656
3654
CLASS_MODE_ALT_EXT : CLASS_MODE_NORMAL ;
3655
+
3656
+ /* Jump here from '(?[...])'. That jump must initialize class_mode_state,
3657
+ set c to the '[' character, and ptr to just after the '['. */
3658
+
3657
3659
FROM_PERL_EXTENDED_CLASS :
3658
3660
okquantifier = TRUE;
3659
3661
@@ -4947,12 +4949,7 @@ while (ptr < ptrend)
4947
4949
(IS_DIGIT (* ptr ))? -1 :(int )(cb -> bracount ), /* + and - are relative */
4948
4950
MAX_GROUP_NUMBER , ERR61 ,
4949
4951
& i , & errorcode )) goto FAILED ;
4950
- if (i < 0 ) /* NB (?0) is permitted */
4951
- {
4952
- // XXX Can we change this block to be PCRE2_ASSERT(i >= 0)? How can read_number return a negative value?
4953
- errorcode = ERR15 ; /* Unknown group */
4954
- goto FAILED_BACK ;
4955
- }
4952
+ PCRE2_ASSERT (i >= 0 ); /* NB (?0) is permitted, represented by i=0 */
4956
4953
if (ptr >= ptrend || * ptr != CHAR_RIGHT_PARENTHESIS )
4957
4954
goto UNCLOSED_PARENTHESIS ;
4958
4955
0 commit comments