static int gen_error;
struct type **gen_tphead(), **gen_tpmiddle();
struct sdef *gen_align_to_next();
+struct e_stack *p_stack;
}
/* initial_value recursively guides the initialisation expression.
]
;
-initial_value_pack(struct type **tpp; struct expr **expp;) :
+initial_value_pack(struct type **tpp; struct expr **expp;)
+ { static int level; }
+:
'{'
+ { if (level == 0) gen_error = 0; level++; }
initial_value_list(tpp, expp)
+ { level--;
+ if (! level) {
+ while (p_stack) {
+ struct e_stack *p = p_stack->next;
+
+ free_e_stack(p_stack);
+ p_stack = p;
+ }
+ }
+ }
'}'
;
}
}
-struct e_stack *p_stack;
-
struct type **
arr_elem(tpp, p)
struct type **tpp;
struct type **tpp;
{
register struct type *tp = *tpp;
- register struct e_stack *p = new_e_stack();
+ register struct e_stack *p;
register struct sdef *sd;
if (gen_error) return tpp;
+ p = new_e_stack();
p->next = p_stack;
p_stack = p;
p->s_nested = nest;
register struct sdef *sd;
register struct e_stack *p = p_stack;
- if (gen_error) return p->s_tpp;
+ if (gen_error) if (p) return p->s_tpp; else return 0;
again:
tp = *(p->s_tpp);
switch(tp->tp_fund) {