Fix #2212 - TinyCC struct parse crash

This commit is contained in:
pancake 2015-03-23 01:14:44 +01:00
parent 2361d43034
commit 08d7137ef1

View File

@ -1829,6 +1829,9 @@ ST_FUNC void unary(void)
if (tok != '(')
tcc_error("'%s' undeclared", get_tok_str(t, NULL));
}
if (!s) {
tcc_error("invalid declaration '%s'", get_tok_str(t, NULL));
}
if ((s->type.t & (VT_STATIC | VT_INLINE | VT_BTYPE)) ==
(VT_STATIC | VT_INLINE | VT_FUNC)) {
/* if referencing an inline function, then we generate a