History

fix preprocessing *.S with ` ' chars in #comments

with a test program. Problem detected when trying to compile linux-2.4.37.9 with tcc.

seyko committed 10 years ago

Commit 16cbca21 parent 5fb57be3 files · +17 −1Browse files

Unified · Split

3 files
  1. tccpp.c +5 −1
  2. tests/pp/13.S +6 −0
  3. tests/pp/13.expect +6 −0
tccpp.c+5−1
@@ -796,8 +796,10 @@ redo_start: · 795 unmodified lines
796 in_warn_or_error = 1;796 in_warn_or_error = 1;
797 else if (tok == TOK_LINEFEED)797 else if (tok == TOK_LINEFEED)
798 goto redo_start;798 goto redo_start;
799 else if (parse_flags & PARSE_FLAG_ASM_FILE)
800 p = parse_line_comment(p);
799 } else if (parse_flags & PARSE_FLAG_ASM_FILE)801 } else if (parse_flags & PARSE_FLAG_ASM_FILE)
800 p = parse_line_comment(p);802 p = parse_line_comment(p);
801 break;803 break;
802_default:804_default:
803 default:805 default:
@@ -2743,6 +2745,8 @@ maybe_newline: · 1939 unmodified lines
2743 p++;2745 p++;
2744 break;2746 break;
2745 default:2747 default:
2748 if (parse_flags & PARSE_FLAG_ASM_FILE)
2749 goto parse_simple;
2746 tcc_error("unrecognized character \\x%02x", c);2750 tcc_error("unrecognized character \\x%02x", c);
2747 break;2751 break;
2748 }2752 }
tests/pp/13.S+6−0
@@ -0,0 +1,6 @@
1# `modelist' label. Each video mode record looks like:
2#ifdef AAA
3# modelist' label. Each video mode record looks like:
4#endif
5.text
6endtext:
tests/pp/13.expect+6−0
@@ -0,0 +1,6 @@
1# `modelist' label. Each video mode record looks like:
2
3
4
5.text
6endtext:

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t