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:
seyko 2015-09-25 02:31:34 +03:00
parent e7e7a0d301
commit 8077f0acc7

View File

@ -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;