History

suppressed ch1 and preparser

bellard committed 23 years ago

Commit 2956bd81 parent e926c352 files · +320 −180Browse files

Unified · Split

2 files
  1. tcc.c +238 −137
  2. tccelf.c +82 −43
tcc.c+238−137
@@ -43,7 +43,8 @@ · 42 unmodified lines
4343
4444 #include "libtcc.h"
4545
46−//#define DEBUG
46+/* parser debug */
47+//#define PARSE_DEBUG
4748 /* preprocessor debug */
4849 //#define PP_DEBUG
4950 /* include file debug */
@@ -249,7 +250,7 @@ typedef struct CachedInclude { · 199 unmodified lines
249250
250251 /* parser */
251252 struct BufferedFile *file;
252−int ch, ch1, tok, tok1;
253+int ch, tok, tok1;
253254 CValue tokc, tok1c;
254255 CString tokcstr; /* current parsed string, if any */
255256 /* if true, line feed is returned as a token. line feed is also
@@ -1481,7 +1482,7 @@ BufferedFile *tcc_open(TCCState *s1, const char *filename) · 1225 unmodified lines
14811482 bf->buf_end = bf->buffer;
14821483 bf->buffer[0] = CH_EOB; /* put eob symbol */
14831484 pstrcpy(bf->filename, sizeof(bf->filename), filename);
1484− bf->line_num = 1;
1485+ bf->line_num = 0;
14851486 bf->ifndef_macro = 0;
14861487 bf->ifdef_stack_ptr = s1->ifdef_stack_ptr;
14871488 // printf("opening '%s'\n", filename);
@@ -1495,9 +1496,6 @@ void tcc_close(BufferedFile *bf) · 7 unmodified lines
14951496 tcc_free(bf);
14961497 }
14971498
1498−/* read one char. MUST call tcc_fillbuf if CH_EOB is read */
1499−#define TCC_GETC(bf) (*(bf)->buf_ptr++)
1500−
15011499 /* fill input buffer and return next char */
15021500 int tcc_getc_slow(BufferedFile *bf)
15031501 {
@@ -1534,12 +1532,12 @@ void handle_eob(void) · 30 unmodified lines
15341532 return;
15351533
15361534 for(;;) {
1537− ch1 = tcc_getc_slow(file);
1538− if (ch1 != CH_EOF)
1535+ ch = tcc_getc_slow(file);
1536+ if (ch != CH_EOF)
15391537 return;
15401538 eof_seen = 1;
15411539 if (return_linefeed) {
1542− ch1 = '\n';
1540+ ch = '\n';
15431541 return;
15441542 }
15451543 if (s1->include_stack_ptr == s1->include_stack)
@@ -1555,81 +1553,101 @@ void handle_eob(void) · 9 unmodified lines
15551553 }
15561554 }
15571555
1558−/* read next char from current input file */
1556+/* read next char from current input file and handle end of input buffer */
15591557 static inline void inp(void)
15601558 {
1561− ch1 = TCC_GETC(file);
1559+ ch = *(file->buf_ptr++);
15621560 /* end of buffer/file handling */
1563− if (ch1 == CH_EOB)
1561+ if (ch == CH_EOB)
15641562 handle_eob();
1565− if (ch1 == '\n')
1566− file->line_num++;
1567− // printf("ch1=%c 0x%x\n", ch1, ch1);
15681563 }
15691564
1570−/* handle '\\n' and '\\r\n' */
1565+/* handle '\[\r]\n' */
15711566 static void handle_stray(void)
15721567 {
1573− do {
1574− if (ch1 == '\n') {
1568+ while (ch == '\\') {
1569+ inp();
1570+ if (ch == '\n') {
1571+ file->line_num++;
15751572 inp();
1576− } else if (ch1 == '\r') {
1573+ } else if (ch == '\r') {
15771574 inp();
1578− if (ch1 != '\n')
1579− error("invalid character after '\\'");
1575+ if (ch != '\n')
1576+ goto fail;
1577+ file->line_num++;
15801578 inp();
15811579 } else {
1582− break;
1580+ fail:
1581+ error("stray '\\' in program");
15831582 }
1584− ch = ch1;
1585− inp();
1586− } while (ch == '\\');
1583+ }
15871584 }
15881585
1589−/* input with '\\n' handling. Also supports '\\r\n' for horrible MSDOS
1590− case */
1591−static inline void minp(void)
1586+/* input with '\[\r]\n' handling. Note that this function cannot
1587+ handle other characters after '\', so you cannot call it inside
1588+ strings or comments */
1589+static void minp(void)
15921590 {
1593− ch = ch1;
15941591 inp();
15951592 if (ch == '\\')
15961593 handle_stray();
15971594 }
15981595
15991596
1600−/* same as minp, but also skip comments */
1601−static void cinp(void)
1597+static void parse_line_comment(void)
16021598 {
1603− int c;
1604−
1605− if (ch1 == '/') {
1599+ /* single line C++ comments */
1600+ /* XXX: accept '\\\n' ? */
1601+ inp();
1602+ while (ch != '\n' && ch != TOK_EOF)
16061603 inp();
1607− if (ch1 == '/') {
1608− /* single line C++ comments */
1604+}
1605+
1606+static void parse_comment(void)
1607+{
1608+ /* C comments */
1609+ minp();
1610+ for(;;) {
1611+ /* fast skip loop */
1612+ while (ch != '\n' && ch != '*' && ch != TOK_EOF)
16091613 inp();
1610− while (ch1 != '\n' && ch1 != CH_EOF)
1611− inp();
1612− ch = ' '; /* return space */
1613− } else if (ch1 == '*') {
1614− /* C comments */
1614+ /* now we can handle all the cases */
1615+ if (ch == '\n') {
1616+ file->line_num++;
16151617 inp();
1616− while (ch1 != CH_EOF) {
1617− c = ch1;
1618− inp();
1619− if (c == '*' && ch1 == '/') {
1618+ } else if (ch == '*') {
1619+ for(;;) {
16201620 inp();
1621− ch = ' '; /* return space */
1622− break;
1623− }
1621+ if (ch == '/') {
1622+ goto end_of_comment;
1623+ } else if (ch == '\\') {
1624+ inp();
1625+ if (ch == '\n') {
1626+ file->line_num++;
1627+ inp();
1628+ } else if (ch == '\r') {
1629+ inp();
1630+ if (ch != '\n')
1631+ break;
1632+ file->line_num++;
1633+ inp();
1634+ } else {
1635+ break;
1636+ }
1637+ } else if (ch != '*') {
1638+ break;
1639+ }
16241640 }
16251641 } else {
1626− ch = '/';
1642+ error("unexpected end of file in comment");
16271643 }
1628− } else {
1629− minp();
16301644 }
1645+ end_of_comment:
1646+ inp();
16311647 }
16321648
1649+#define cinp minp
1650+
16331651 /* space exlcuding newline */
16341652 static inline int is_space(int ch)
16351653 {
@@ -1646,28 +1664,85 @@ static inline void skip_spaces(void) · 10 unmodified lines
16461664 #if/#endif */
16471665 void preprocess_skip(void)
16481666 {
1649− int a;
1667+ int a, start_of_line, sep;
1668+
1669+ start_of_line = 1;
16501670 a = 0;
16511671 while (1) {
1652− while (ch != '\n') {
1653− if (ch == CH_EOF)
1654− expect("#endif");
1655− cinp();
1656− }
1657− cinp();
1658− skip_spaces();
1659− if (ch == '#') {
1660− cinp();
1661− next_nomacro();
1662− if (a == 0 &&
1663− (tok == TOK_ELSE || tok == TOK_ELIF || tok == TOK_ENDIF))
1664− break;
1665− if (tok == TOK_IF || tok == TOK_IFDEF || tok == TOK_IFNDEF)
1666− a++;
1667− else if (tok == TOK_ENDIF)
1668− a--;
1672+ switch(ch) {
1673+ case ' ':
1674+ case '\t':
1675+ case '\f':
1676+ case '\v':
1677+ case '\r':
1678+ inp();
1679+ break;
1680+ case '\n':
1681+ start_of_line = 1;
1682+ file->line_num++;
1683+ inp();
1684+ break;
1685+ case '\\':
1686+ handle_stray();
1687+ break;
1688+ /* skip strings */
1689+ case '\"':
1690+ case '\'':
1691+ start_of_line = 0;
1692+ sep = ch;
1693+ inp();
1694+ while (ch != sep) {
1695+ /* XXX: better error message */
1696+ if (ch == TOK_EOF) {
1697+ error("unterminated string");
1698+ } else if (ch == '\n') {
1699+ file->line_num++;
1700+ } else if (ch == '\\') {
1701+ /* ignore next char */
1702+ inp();
1703+ if (ch == '\n')
1704+ file->line_num++;
1705+ }
1706+ inp();
1707+ }
1708+ minp();
1709+ break;
1710+ /* skip comments */
1711+ case '/':
1712+ minp();
1713+ if (ch == '*') {
1714+ parse_comment();
1715+ } else if (ch == '/') {
1716+ parse_line_comment();
1717+ } else {
1718+ start_of_line = 0;
1719+ }
1720+ break;
1721+
1722+ case '#':
1723+ minp();
1724+ if (start_of_line) {
1725+ next_nomacro();
1726+ if (a == 0 &&
1727+ (tok == TOK_ELSE || tok == TOK_ELIF || tok == TOK_ENDIF))
1728+ goto the_end;
1729+ if (tok == TOK_IF || tok == TOK_IFDEF || tok == TOK_IFNDEF)
1730+ a++;
1731+ else if (tok == TOK_ENDIF)
1732+ a--;
1733+ }
1734+ start_of_line = 0;
1735+ break;
1736+ case CH_EOF:
1737+ expect("#endif");
1738+ break;
1739+ default:
1740+ inp();
1741+ start_of_line = 0;
1742+ break;
16691743 }
16701744 }
1745+ the_end: ;
16711746 }
16721747
16731748 /* ParseState handling */
@@ -1927,7 +2002,7 @@ int expr_preprocess(void) · 253 unmodified lines
19272002 return c != 0;
19282003 }
19292004
1930−#if defined(DEBUG) || defined(PP_DEBUG)
2005+#if defined(PARSE_DEBUG) || defined(PP_DEBUG)
19312006 void tok_print(int *str)
19322007 {
19332008 int t;
@@ -2054,7 +2129,6 @@ void preprocess(void) · 120 unmodified lines
20542129 state = INCLUDE_STATE_NONE;
20552130 eof_seen = 0;
20562131 redo1:
2057− cinp();
20582132 next_nomacro();
20592133 redo:
20602134 switch(tok) {
@@ -2085,10 +2159,12 @@ void preprocess(void) · 24 unmodified lines
20852159 minp();
20862160 }
20872161 *q = '\0';
2162+#if 0
20882163 /* eat all spaces and comments after include */
20892164 /* XXX: slightly incorrect */
20902165 while (ch1 != '\n' && ch1 != CH_EOF)
20912166 inp();
2167+#endif
20922168 } else {
20932169 /* computed #include : either we have only strings or
20942170 we have anything enclosed in '<>' */
@@ -2185,6 +2261,7 @@ void preprocess(void) · 90 unmodified lines
21852261 if (ch != '#')
21862262 goto the_end;
21872263 state = INCLUDE_STATE_SEEK_IFNDEF;
2264+ cinp();
21882265 goto redo1;
21892266 }
21902267 break;
@@ -2324,7 +2401,7 @@ static int getn(int b) · 133 unmodified lines
23242401 if (t < 0 || t >= b)
23252402 break;
23262403 n = n * b + t;
2327− cinp();
2404+ inp();
23282405 }
23292406 return n;
23302407 }
@@ -2334,50 +2411,76 @@ static int getq(void) · 3 unmodified lines
23342411 {
23352412 int c;
23362413
2414+ redo:
23372415 c = ch;
2338− minp();
2416+ inp();
23392417 if (c == '\\') {
2340− if (isoct(ch)) {
2418+ switch(ch) {
2419+ case '0': case '1': case '2': case '3':
2420+ case '4': case '5': case '6': case '7':
23412421 /* at most three octal digits */
23422422 c = ch - '0';
2343− minp();
2423+ inp();
23442424 if (isoct(ch)) {
23452425 c = c * 8 + ch - '0';
2346− minp();
2426+ inp();
23472427 if (isoct(ch)) {
23482428 c = c * 8 + ch - '0';
2349− minp();
2429+ inp();
23502430 }
23512431 }
23522432 return c;
2353− } else if (ch == 'x') {
2354− minp();
2433+ case 'x':
2434+ inp();
23552435 return getn(16);
2356− } else {
2357− if (ch == 'a')
2358− c = '\a';
2359− else if (ch == 'b')
2360− c = '\b';
2361− else if (ch == 'f')
2362− c = '\f';
2363− else if (ch == 'n')
2364− c = '\n';
2365− else if (ch == 'r')
2366− c = '\r';
2367− else if (ch == 't')
2368− c = '\t';
2369− else if (ch == 'v')
2370− c = '\v';
2371− else if (ch == 'e' && gnu_ext)
2372− c = 27;
2373− else if (ch == '\'' || ch == '\"' || ch == '\\' || ch == '?')
2374− c = ch;
2375− else
2376− error("invalid escaped char");
2377− minp();
2436+ case 'a':
2437+ c = '\a';
2438+ break;
2439+ case 'b':
2440+ c = '\b';
2441+ break;
2442+ case 'f':
2443+ c = '\f';
2444+ break;
2445+ case 'n':
2446+ c = '\n';
2447+ break;
2448+ case 'r':
2449+ c = '\r';
2450+ break;
2451+ case 't':
2452+ c = '\t';
2453+ break;
2454+ case 'v':
2455+ c = '\v';
2456+ break;
2457+ case 'e':
2458+ if (!gnu_ext)
2459+ goto invalid_escape;
2460+ c = 27;
2461+ break;
2462+ case '\'':
2463+ case '\"':
2464+ case '\\':
2465+ case '?':
2466+ c = ch;
2467+ break;
2468+ case '\n':
2469+ inp();
2470+ goto redo;
2471+ case '\r':
2472+ inp();
2473+ if (ch != '\n')
2474+ goto invalid_escape;
2475+ inp();
2476+ goto redo;
2477+ default:
2478+ invalid_escape:
2479+ error("invalid escaped char");
23782480 }
2481+ inp();
23792482 } else if (c == '\r' && ch == '\n') {
2380− minp();
2483+ inp();
23812484 c = '\n';
23822485 }
23832486 return c;
@@ -2677,10 +2780,11 @@ void parse_number(const char *p) · 293 unmodified lines
26772780 /* return next token without macro substitution */
26782781 static inline void next_nomacro1(void)
26792782 {
2680− int b, t;
2783+ int b, t, start_of_line;
26812784 char *q;
26822785 TokenSym *ts;
26832786
2787+ start_of_line = 0;
26842788 redo_no_start:
26852789 switch(ch) {
26862790 case ' ':
@@ -2688,38 +2792,36 @@ static inline void next_nomacro1(void) · 1 unmodified line
26882792 case '\f':
26892793 case '\v':
26902794 case '\r':
2691− cinp();
2795+ inp();
26922796 goto redo_no_start;
26932797
2798+ case '\\':
2799+ handle_stray();
2800+ goto redo_no_start;
2801+
26942802 case '\n':
2803+ file->line_num++;
26952804 if (return_linefeed) {
26962805 /* XXX: should eat token ? */
26972806 tok = TOK_LINEFEED;
26982807 } else {
2699− cinp();
2700− skip_spaces();
2701− if (ch == '#') {
2702− /* preprocessor command if # at start of line after
2703− spaces */
2704− preprocess();
2705− }
2808+ start_of_line = 1;
2809+ inp();
27062810 goto redo_no_start;
27072811 }
27082812 break;
27092813
27102814 case '#':
2711− tok = ch;
2712− cinp();
2713−#if 0
2815+ minp();
27142816 if (start_of_line) {
27152817 preprocess();
27162818 goto redo_no_start;
2717− } else
2718−#endif
2719− {
2819+ } else {
27202820 if (ch == '#') {
2721− cinp();
2821+ inp();
27222822 tok = TOK_TWOSHARPS;
2823+ } else {
2824+ tok = '#';
27232825 }
27242826 }
27252827 break;
@@ -2754,7 +2856,7 @@ static inline void next_nomacro1(void) · 28 unmodified lines
27542856 tok = ts->tok;
27552857 break;
27562858 case 'L':
2757− cinp();
2859+ minp();
27582860 if (ch == '\'') {
27592861 tok = TOK_LCHAR;
27602862 goto char_const;
@@ -2810,7 +2912,7 @@ static inline void next_nomacro1(void) · 49 unmodified lines
28102912 case '\'':
28112913 tok = TOK_CCHAR;
28122914 char_const:
2813− minp();
2915+ inp();
28142916 b = getq();
28152917 /* this cast is needed if >= 128 */
28162918 if (tok == TOK_CCHAR)
@@ -2818,12 +2920,12 @@ static inline void next_nomacro1(void) · 1 unmodified line
28182920 tokc.i = b;
28192921 if (ch != '\'')
28202922 error("unterminated character constant");
2821− minp();
2923+ inp();
28222924 break;
28232925 case '\"':
28242926 tok = TOK_STR;
28252927 str_const:
2826− minp();
2928+ inp();
28272929 cstr_reset(&tokcstr);
28282930 while (ch != '\"') {
28292931 b = getq();
@@ -2839,7 +2941,7 @@ static inline void next_nomacro1(void) · 9 unmodified lines
28392941 else
28402942 cstr_wccat(&tokcstr, '\0');
28412943 tokc.cstr = &tokcstr;
2842− minp();
2944+ inp();
28432945 break;
28442946
28452947 case '<':
@@ -2976,18 +3078,19 @@ static inline void next_nomacro1(void) · 130 unmodified lines
29763078
29773079 /* comments or operator */
29783080 case '/':
2979− tok = ch;
2980− cinp();
2981− if (ch == '=') {
3081+ minp();
3082+ if (ch == '*') {
3083+ parse_comment();
3084+ goto redo_no_start;
3085+ } else if (ch == '/') {
3086+ parse_line_comment();
3087+ goto redo_no_start;
3088+ } else if (ch == '=') {
29823089 cinp();
29833090 tok = TOK_A_DIV;
2984− }
2985−#if 0
2986− else if (ch == '/' || ch == '*') {
2987− parse_comments();
2988− goto redo_no_start;
3091+ } else {
3092+ tok = '/';
29893093 }
2990−#endif
29913094 break;
29923095
29933096 /* simple tokens */
@@ -3012,6 +3115,9 @@ static inline void next_nomacro1(void) · 18 unmodified lines
30123115 error("unrecognized character \\x%02x", ch);
30133116 break;
30143117 }
3118+#if defined(PARSE_DEBUG)
3119+ printf("token = %s\n", get_tok_str(tok, &tokc));
3120+#endif
30153121 }
30163122
30173123 /* return next token without macro substitution. Can read input from
@@ -3437,9 +3543,6 @@ static void next(void) · 419 unmodified lines
34373543 parse_number((char *)tokc.cstr->data);
34383544 }
34393545 }
3440−#if defined(DEBUG)
3441− printf("token = %s\n", get_tok_str(tok, &tokc));
3442−#endif
34433546 }
34443547
34453548 void swap(int *p, int *q)
@@ -7539,7 +7642,6 @@ static int tcc_compile(TCCState *s1) · 4093 unmodified lines
75397642 s1->nb_errors = 0;
75407643 s1->error_set_jmp_enabled = 1;
75417644
7542− inp();
75437645 ch = '\n'; /* needed to parse correctly first preprocessor command */
75447646 next();
75457647 decl(VT_CONST);
@@ -7617,7 +7719,6 @@ void tcc_define_symbol(TCCState *s1, const char *sym, const char *value) · 71 unmodified lines
76177719 s1->include_stack_ptr = s1->include_stack;
76187720
76197721 /* parse with define parser */
7620− inp();
76217722 ch = '\n'; /* needed to parse correctly first preprocessor command */
76227723 next_nomacro();
76237724 parse_define();
tccelf.c+82−43
@@ -378,7 +378,7 @@ static void relocate_common_syms(void) · 377 unmodified lines
378378
379379 static void *resolve_sym(const char *sym)
380380 {
381− return dlsym(NULL, sym);
381+ return dlsym(RTLD_DEFAULT, sym);
382382 }
383383
384384 /* relocate symbol table, resolve undefined symbols if do_resolve is
@@ -1813,71 +1813,110 @@ static int tcc_load_dll(TCCState *s1, int fd, const char *filename, int level) · 1428 unmodified lines
18131813 return ret;
18141814 }
18151815
1816−/* return -2 if error and CH_EOF if eof */
1817−static void ld_skipspaces(void)
1818−{
1819− while (ch == ' ' || ch == '\t' || ch == '\n')
1820− cinp();
1821−}
1816+#define LD_TOK_NAME 256
1817+#define LD_TOK_EOF (-1)
18221818
1823−static int ld_get_cmd(char *cmd, int cmd_size)
1819+/* return next ld script token */
1820+static int ld_next(TCCState *s1, char *name, int name_size)
18241821 {
1822+ int c;
18251823 char *q;
18261824
1827− ld_skipspaces();
1828− if (ch == CH_EOF)
1829− return -1;
1830− q = cmd;
1831− for(;;) {
1832− if (!((ch >= 'a' && ch <= 'z') ||
1833− (ch >= 'A' && ch <= 'Z') ||
1834− (ch >= '0' && ch <= '9') ||
1835− strchr("/.-_+=$:\\,~?*", ch)))
1836− break;
1837− if ((q - cmd) >= (cmd_size - 1))
1838− return -2;
1839− *q++ = ch;
1840− cinp();
1825+ redo:
1826+ switch(ch) {
1827+ case ' ':
1828+ case '\t':
1829+ case '\f':
1830+ case '\v':
1831+ case '\r':
1832+ case '\n':
1833+ inp();
1834+ goto redo;
1835+ case '/':
1836+ minp();
1837+ if (ch == '*') {
1838+ parse_comment();
1839+ goto redo;
1840+ } else {
1841+ q = name;
1842+ *q++ = '/';
1843+ goto parse_name;
1844+ }
1845+ break;
1846+ case 'a' ... 'z':
1847+ case 'A' ... 'Z':
1848+ case '_':
1849+ case '\\':
1850+ case '.':
1851+ case '$':
1852+ case '~':
1853+ q = name;
1854+ parse_name:
1855+ for(;;) {
1856+ if (!((ch >= 'a' && ch <= 'z') ||
1857+ (ch >= 'A' && ch <= 'Z') ||
1858+ (ch >= '0' && ch <= '9') ||
1859+ strchr("/.-_+=$:\\,~", ch)))
1860+ break;
1861+ if ((q - name) < name_size - 1) {
1862+ *q++ = ch;
1863+ }
1864+ minp();
1865+ }
1866+ *q = '\0';
1867+ c = LD_TOK_NAME;
1868+ break;
1869+ case CH_EOF:
1870+ c = LD_TOK_EOF;
1871+ break;
1872+ default:
1873+ c = ch;
1874+ inp();
1875+ break;
18411876 }
1842− *q = '\0';
1843− return 0;
1877+#if 0
1878+ printf("tok=%c %d\n", c, c);
1879+ if (c == LD_TOK_NAME)
1880+ printf(" name=%s\n", name);
1881+#endif
1882+ return c;
18441883 }
1845−
1884+
18461885 /* interpret a subset of GNU ldscripts to handle the dummy libc.so
18471886 files */
18481887 static int tcc_load_ldscript(TCCState *s1)
18491888 {
18501889 char cmd[64];
18511890 char filename[1024];
1852− int ret;
1891+ int t;
18531892
18541893 inp();
1855− cinp();
18561894 for(;;) {
1857− ret = ld_get_cmd(cmd, sizeof(cmd));
1858− if (ret == CH_EOF)
1895+ t = ld_next(s1, cmd, sizeof(cmd));
1896+ if (t == LD_TOK_EOF)
18591897 return 0;
1860− else if (ret < 0)
1898+ else if (t != LD_TOK_NAME)
18611899 return -1;
1862− // printf("cmd='%s'\n", cmd);
18631900 if (!strcmp(cmd, "INPUT") ||
18641901 !strcmp(cmd, "GROUP")) {
1865− ld_skipspaces();
1866− if (ch != '(')
1902+ t = ld_next(s1, cmd, sizeof(cmd));
1903+ if (t != '(')
18671904 expect("(");
1868− cinp();
1905+ t = ld_next(s1, filename, sizeof(filename));
18691906 for(;;) {
1870− ld_get_cmd(filename, sizeof(filename));
1871− tcc_add_file(s1, filename);
1872− ld_skipspaces();
1873− if (ch == ',') {
1874− cinp();
1875− } else if (ch == ')') {
1876− cinp();
1877− break;
1878− } else if (ch == CH_EOF) {
1907+ if (t == LD_TOK_EOF) {
18791908 error_noabort("unexpected end of file");
18801909 return -1;
1910+ } else if (t == ')') {
1911+ break;
1912+ } else if (t != LD_TOK_NAME) {
1913+ error_noabort("filename expected");
1914+ return -1;
1915+ }
1916+ tcc_add_file(s1, filename);
1917+ t = ld_next(s1, filename, sizeof(filename));
1918+ if (t == ',') {
1919+ t = ld_next(s1, filename, sizeof(filename));
18811920 }
18821921 }
18831922 } else {

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