a number as a field name (part 2)
don't crash a test program: ================ typedef struct X { int len; } X; #define init(s,len) s.len = len; int main(void) { X myX; init(myX,10); return 0; } ================ After a patch: error: field name expected
This commit is contained in:
parent
e7e7a0d301
commit
8077f0acc7
1 changed files with 2 additions and 0 deletions
2
tccgen.c
2
tccgen.c
|
@ -4166,6 +4166,8 @@ ST_FUNC void unary(void)
|
|||
if (tok == TOK_CDOUBLE)
|
||||
expect("field name");
|
||||
next();
|
||||
if (tok == TOK_CINT || tok == TOK_CUINT)
|
||||
expect("field name");
|
||||
s = vtop->type.ref;
|
||||
/* find field */
|
||||
tok |= SYM_FIELD;
|
||||
|
|
Loading…
Add table
Reference in a new issue