bug fix: static link was not always removed

This commit is contained in:
ceriel 1989-11-16 14:57:15 +00:00
parent 72f667fbf9
commit e93e256512
2 changed files with 12 additions and 3 deletions

View file

@ -320,7 +320,8 @@ ProcedureHeading(register struct node **pnd; register struct type **ptp;)
|
/* empty */
{ *ptp =
proc_type((struct paramlist *)0, (arith) 0);
proc_type((struct paramlist *)0,
(proclevel > 1) ? pointer_size : (arith) 0);
}
]
;
@ -383,7 +384,7 @@ FunctionHeading(register struct node **pnd; register struct type **ptp;)
struct node *fpl = NULLNODE;
struct type *tp;
struct paramlist *pr = 0;
arith nb_pars = 0;
arith nb_pars = (proclevel > 1) ? pointer_size : 0;
} :
FUNCTION
IDENT { *pnd = MkLeaf(Name, &dot);

View file

@ -157,7 +157,15 @@ DoDirective(directive, nd, tp, scl, function)
df->df_type = tp;
df->prc_vis = scl;
df->prc_name = gen_proc_name(nd->nd_IDF, inp);
if( ext ) df->df_flags |= D_EXTERNAL;
if( ext ) {
if (!(df->df_flags & D_EXTERNAL) && proclevel > 1)
tp->prc_nbpar -= pointer_size;
/* was added for static link which is not needed now.
But make sure this is done only once (look at the
D_EXTERNAL flag).
*/
df->df_flags |= D_EXTERNAL;
}
df->df_flags |= D_SET;
}
}