File tree 1 file changed +14
-0
lines changed
src/libsyntax/parse/lexer
1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -1452,6 +1452,13 @@ impl<'a> StringReader<'a> {
1452
1452
self . bump ( ) ;
1453
1453
let mut hash_count: u16 = 0 ;
1454
1454
while self . ch_is ( '#' ) {
1455
+ if hash_count == 65535 {
1456
+ let bpos = self . next_pos ;
1457
+ self . fatal_span_ ( start_bpos,
1458
+ bpos,
1459
+ "too many `#` symbols: raw strings may be \
1460
+ delimited by up to 65535 `#` symbols") . raise ( ) ;
1461
+ }
1455
1462
self . bump ( ) ;
1456
1463
hash_count += 1 ;
1457
1464
}
@@ -1682,6 +1689,13 @@ impl<'a> StringReader<'a> {
1682
1689
self . bump ( ) ;
1683
1690
let mut hash_count = 0 ;
1684
1691
while self . ch_is ( '#' ) {
1692
+ if hash_count == 65535 {
1693
+ let bpos = self . next_pos ;
1694
+ self . fatal_span_ ( start_bpos,
1695
+ bpos,
1696
+ "too many `#` symbols: raw byte strings may be \
1697
+ delimited by up to 65535 `#` symbols") . raise ( ) ;
1698
+ }
1685
1699
self . bump ( ) ;
1686
1700
hash_count += 1 ;
1687
1701
}
You can’t perform that action at this time.
0 commit comments