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 @@ -1450,6 +1450,13 @@ impl<'a> StringReader<'a> {
14501450 self . bump ( ) ;
14511451 let mut hash_count: u16 = 0 ;
14521452 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+ }
14531460 self . bump ( ) ;
14541461 hash_count += 1 ;
14551462 }
@@ -1680,6 +1687,13 @@ impl<'a> StringReader<'a> {
16801687 self . bump ( ) ;
16811688 let mut hash_count = 0 ;
16821689 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+ }
16831697 self . bump ( ) ;
16841698 hash_count += 1 ;
16851699 }
You can’t perform that action at this time.
0 commit comments