File tree Expand file tree Collapse file tree 2 files changed +17
-0
lines changed Expand file tree Collapse file tree 2 files changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -508,6 +508,8 @@ token_t lex_token_internal(bool aliasing)
508
508
token_str [i - 1 ] = next_char ;
509
509
}
510
510
} else {
511
+ if (i >= MAX_TOKEN_LEN - 1 )
512
+ error ("String literal too long" );
511
513
token_str [i ++ ] = next_char ;
512
514
}
513
515
if (next_char == '\\' )
Original file line number Diff line number Diff line change @@ -3659,6 +3659,21 @@ int main() {
3659
3659
}
3660
3660
EOF
3661
3661
3662
+ # String literal and escape coverage (additional)
3663
+ try_output 0 " AZ" << 'EOF '
3664
+ int main() {
3665
+ printf("%s", "\\x41Z"); /* hex escape then normal char */
3666
+ return 0;
3667
+ }
3668
+ EOF
3669
+
3670
+ try_output 0 " AZ" << 'EOF '
3671
+ int main() {
3672
+ printf("%s", "A\\132"); /* octal escape for 'Z' */
3673
+ return 0;
3674
+ }
3675
+ EOF
3676
+
3662
3677
# Cast zero value
3663
3678
try_ 0 << EOF
3664
3679
int main() {
You can’t perform that action at this time.
0 commit comments