fixed bug with function returning pointer to function
This commit is contained in:
parent
456ba2b03c
commit
0b35c31e5b
3 changed files with 13 additions and 3 deletions
|
@ -560,8 +560,11 @@ check_formals(idf, dc)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
while (du && du->du_fund != FUNCTION)
|
while (du
|
||||||
|
&& (du->du_fund != FUNCTION
|
||||||
|
|| du->next != (struct decl_unary *) 0)) {
|
||||||
du = du->next;
|
du = du->next;
|
||||||
|
}
|
||||||
if (!du) return; /* terrible error, signalled earlier */
|
if (!du) return; /* terrible error, signalled earlier */
|
||||||
|
|
||||||
if (du->du_proto) return;
|
if (du->du_proto) return;
|
||||||
|
|
|
@ -176,6 +176,7 @@ struct idf **idpp;
|
||||||
return tg;
|
return tg;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
declare_protos(dc)
|
declare_protos(dc)
|
||||||
register struct declarator *dc;
|
register struct declarator *dc;
|
||||||
{
|
{
|
||||||
|
@ -193,8 +194,15 @@ declare_protos(dc)
|
||||||
dumpidftab("start declare_protos", 0);
|
dumpidftab("start declare_protos", 0);
|
||||||
#endif DEBUG
|
#endif DEBUG
|
||||||
du = dc->dc_decl_unary;
|
du = dc->dc_decl_unary;
|
||||||
while (du && du->du_fund != FUNCTION)
|
while (du) {
|
||||||
|
if (du->du_fund == FUNCTION) {
|
||||||
|
if (du->next != (struct decl_unary *) 0) {
|
||||||
|
remove_proto_idfs(du->du_proto);
|
||||||
|
du->du_proto = 0;
|
||||||
|
} else break;
|
||||||
|
}
|
||||||
du = du->next;
|
du = du->next;
|
||||||
|
}
|
||||||
pl = du ? du->du_proto : NO_PROTO;
|
pl = du ? du->du_proto : NO_PROTO;
|
||||||
if (pl) {
|
if (pl) {
|
||||||
#if 0 /* the id_proto member is deleted (???) */
|
#if 0 /* the id_proto member is deleted (???) */
|
||||||
|
|
|
@ -153,7 +153,6 @@ function_of(tp, pl, qual)
|
||||||
if (!dtp) {
|
if (!dtp) {
|
||||||
dtp = create_type(FUNCTION);
|
dtp = create_type(FUNCTION);
|
||||||
dtp->tp_up = tp;
|
dtp->tp_up = tp;
|
||||||
/* dtp->tp_size = pointer_size; ??? */
|
|
||||||
dtp->tp_size = -1; /* function size is not known */
|
dtp->tp_size = -1; /* function size is not known */
|
||||||
dtp->tp_align = pointer_align;
|
dtp->tp_align = pointer_align;
|
||||||
dtp->tp_typequal = qual;
|
dtp->tp_typequal = qual;
|
||||||
|
|
Loading…
Reference in a new issue