diff --git a/tccgen.c b/tccgen.c index fcec8f1..4d85414 100644 --- a/tccgen.c +++ b/tccgen.c @@ -4152,7 +4152,7 @@ ST_FUNC void unary(void) if (tok == TOK_INC || tok == TOK_DEC) { inc(1, tok); next(); - } else if (tok == '.' || tok == TOK_ARROW) { + } else if (tok == '.' || tok == TOK_ARROW || tok == TOK_CDOUBLE) { int qualifiers; /* field */ if (tok == TOK_ARROW) @@ -4160,10 +4160,12 @@ ST_FUNC void unary(void) qualifiers = vtop->type.t & (VT_CONSTANT | VT_VOLATILE); test_lvalue(); gaddrof(); - next(); /* expect pointer on structure */ if ((vtop->type.t & VT_BTYPE) != VT_STRUCT) expect("struct or union"); + if (tok == TOK_CDOUBLE) + expect("field name"); + next(); s = vtop->type.ref; /* find field */ tok |= SYM_FIELD;