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 @@ -1450,6 +1450,13 @@ impl<'a> StringReader<'a> {
1450
1450
self . bump ( ) ;
1451
1451
let mut hash_count: u16 = 0 ;
1452
1452
while self . ch_is ( '#' ) {
1453
+ if hash_count == 65535 {
1454
+ let bpos = self . next_pos ;
1455
+ self . fatal_span_ ( start_bpos,
1456
+ bpos,
1457
+ "too many `#` symbols: raw strings may be \
1458
+ delimited by up to 65535 `#` symbols") . raise ( ) ;
1459
+ }
1453
1460
self . bump ( ) ;
1454
1461
hash_count += 1 ;
1455
1462
}
@@ -1680,6 +1687,13 @@ impl<'a> StringReader<'a> {
1680
1687
self . bump ( ) ;
1681
1688
let mut hash_count = 0 ;
1682
1689
while self . ch_is ( '#' ) {
1690
+ if hash_count == 65535 {
1691
+ let bpos = self . next_pos ;
1692
+ self . fatal_span_ ( start_bpos,
1693
+ bpos,
1694
+ "too many `#` symbols: raw byte strings may be \
1695
+ delimited by up to 65535 `#` symbols") . raise ( ) ;
1696
+ }
1683
1697
self . bump ( ) ;
1684
1698
hash_count += 1 ;
1685
1699
}
You can’t perform that action at this time.
0 commit comments