Check more, when an error occurred

This commit is contained in:
ceriel 1986-11-17 13:08:18 +00:00
parent 9d0ee46068
commit 596c631a71

View file

@ -29,7 +29,7 @@ STATIC
Xerror(nd, mess, edf)
struct node *nd;
char *mess;
struct def *edf;
register struct def *edf;
{
if (edf) {
if (edf->df_kind != D_ERROR) {
@ -517,6 +517,16 @@ ChkProcCall(expp)
if (left->nd_class == Def || left->nd_class == LinkDef) {
edf = left->nd_def;
}
if (left->nd_type == error_type) {
/* Just check parameters as if they were value parameters
*/
expp->nd_type = error_type;
while (expp->nd_right) {
getarg(&expp, 0, 0, edf);
}
return 0;
}
expp->nd_type = RemoveEqual(ResultType(left->nd_type));
/* Check parameter list
@ -564,8 +574,7 @@ ChkCall(expp)
*/
expp->nd_type = error_type;
left = expp->nd_left;
if (! ChkDesignator(left)) return 0;
if (ChkDesignator(left)) {
if (IsCast(left)) {
/* It was a type cast.
*/
@ -581,14 +590,14 @@ ChkCall(expp)
*/
return ChkStandard(expp, left);
}
/* Here, we have found a real procedure call. The left hand
side may also represent a procedure variable.
/* Here, we have found a real procedure call.
The left hand side may also represent a procedure
variable.
*/
return ChkProcCall(expp);
}
node_error(left, "procedure, type, or function expected");
return 0;
else node_error(left, "procedure, type, or function expected");
}
return ChkProcCall(expp);
}
STATIC struct type *