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
796796 in_warn_or_error = 1;
797797 else if (tok == TOK_LINEFEED)
798798 goto redo_start;
799+ else if (parse_flags & PARSE_FLAG_ASM_FILE)
800+ p = parse_line_comment(p);
799801 } else if (parse_flags & PARSE_FLAG_ASM_FILE)
800− p = parse_line_comment(p);
802+ p = parse_line_comment(p);
801803 break;
802804 _default:
803805 default:
@@ -2743,6 +2745,8 @@ maybe_newline: · 1939 unmodified lines
27432745 p++;
27442746 break;
27452747 default:
2748+ if (parse_flags & PARSE_FLAG_ASM_FILE)
2749+ goto parse_simple;
27462750 tcc_error("unrecognized character \\x%02x", c);
27472751 break;
27482752 }
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
6+endtext:
tests/pp/13.expect+6−0
@@ -0,0 +1,6 @@
1+# `modelist' label. Each video mode record looks like:
2+
3+
4+
5+.text
6+endtext:

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