assert(expp->nd_class == Def);
df = expp->nd_def;
+ if (df == ill_df) return 0;
if (df->df_kind & (D_ENUM | D_CONST)) {
if (df->df_kind == D_ENUM) {
return 0;
}
+ if (designator && left->nd_class == Def) {
+ left->nd_def->df_flags |= D_NOREG;
+ }
+
tp = BaseType(left->nd_type);
if (bases && !(tp->tp_fund & bases)) {
if (!(left = getarg(&arg, T_ARRAY, 0))) return 0;
if (IsConformantArray(left->nd_type)) {
/* A conformant array has no explicit index type
+ ??? So, what can we use as index-type ???
*/
- expp->nd_type = card_type;
+ expp->nd_type = intorcard_type;
}
else {
expp->nd_type = IndexType(left->nd_type);
break;
case S_SIZE:
- expp->nd_INT = WA(expr->nd_type->tp_size) / word_size;
+ expp->nd_INT = WA(expr->nd_type->tp_size);
break;
case S_VAL:
referring to the hidden type.
*/
*(df->df_type) = *tp;
+ if (! tp->next) {
+ /* It also contains a forward
+ reference, so update the forward-
+ list
+ */
+ ChForward(tp, df->df_type);
+ }
free_type(tp);
}
else df->df_type = tp;
df->df_kind == D_MODULE)
type(&((*ptp)->next))
|
- IDENT { Forward(&dot, &((*ptp)->next)); }
+ IDENT { Forward(&dot, (*ptp)); }
]
;
struct forwards {
struct forwards *next;
struct node fo_tok;
- struct type **fo_ptyp;
+ struct type *fo_ptyp;
};
/* STATICALLOCDEF "forwards" */
Forward(tk, ptp)
struct token *tk;
- struct type **ptp;
+ struct type *ptp;
{
/* Enter a forward reference into a list belonging to the
current scope. This is used for POINTER declarations, which
CurrentScope->sc_forw = f;
}
+ChForward(was, becomes)
+ struct type *was, *becomes;
+{
+ /* The declaration of a hidden type had a forward reference.
+ In this case, the "forwards" list must be adapted.
+ */
+ register struct forwards *f = CurrentScope->sc_forw;
+
+ while (f && f->fo_ptyp != was) f = f->next;
+ assert(f != 0);
+ f->fo_ptyp = becomes;
+}
+
STATIC
chk_proc(df)
register struct def *df;
node_error(&(f->fo_tok), "identifier \"%s\" not a type",
df->df_idf->id_text);
}
- *(f->fo_ptyp) = df->df_type;
+ f->fo_ptyp->next = df->df_type;
fo = f->next;
free_forwards(f);
}
if ((tp1->tp_fund & T_INTORCARD) &&
(tp2->tp_fund & T_INTORCARD)) return 1;
+ if (tp1->tp_fund == T_PROCEDURE &&
+ tp2->tp_fund == T_PROCEDURE) {
+ return TstProcEquiv(tp1, tp2);
+ }
+
if (tp1->tp_fund == T_ARRAY) {
/* check for string
*/
Call initialization routines of imported modules.
Also prevent recursive calls of this one.
*/
- register struct node *nd;
+ register struct node *nd = Modules;
if (state == IMPLEMENTATION) {
label l1 = ++data_label;
C_zne((label) 1);
C_loc((arith) 1);
C_ste_dlb(l1, (arith) 0);
+ /* Prevent this module from calling its own
+ initialization routine
+ */
+ assert(nd->nd_IDF == module->df_idf);
+ nd = nd->next;
}
- for (nd = Modules; nd; nd = nd->next) {
+ for (; nd; nd = nd->next) {
C_cal(nd->nd_IDF->id_text);
}
}
/* May we do it in this order (expression first) ??? */
struct desig dsl, dsr;
- if (!ChkExpression(right)) return;
+ if (! ChkExpression(right)) return;
if (! ChkVariable(left)) return;
TryToString(right, left->nd_type);
dsr = InitDesig;