File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed
src/libsyntax/parse/lexer Expand file tree Collapse file tree 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> {
14521452 self . bump ( ) ;
14531453 let mut hash_count: u16 = 0 ;
14541454 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+ }
14551462 self . bump ( ) ;
14561463 hash_count += 1 ;
14571464 }
@@ -1682,6 +1689,13 @@ impl<'a> StringReader<'a> {
16821689 self . bump ( ) ;
16831690 let mut hash_count = 0 ;
16841691 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+ }
16851699 self . bump ( ) ;
16861700 hash_count += 1 ;
16871701 }
You can’t perform that action at this time.
0 commit comments