{
register arith *s;
- size += sizeof(arith);
+ size = ((size + (int)word_size - 1) / (int)word_size + 1) * sizeof(arith);
s = (arith *) Malloc(size);
clear((char *) s , size);
s++;
FreeSet(s)
register arith *s;
{
+ dec_refcount(s);
if (refcount(s) <= 0) {
free((char *) (s-1));
}
First allocate room for the set.
*/
- expp->nd_set = MkSet((unsigned)(tp->tp_size) * (sizeof(arith) / (int) word_size));
+ expp->nd_set = MkSet((unsigned)(tp->tp_size));
/* Now check the elements, one by one
*/
#define ChkDesignator(expp) ((*DesigChkTable[(expp)->nd_class])(expp))
#define inc_refcount(s) (*((s) - 1) += 1)
+#define dec_refcount(s) (*((s) - 1) -= 1)
#define refcount(s) (*((s) - 1))
possible earlier definition in the definition module.
*/
- if (df->df_type) {
+ if (df->df_kind == D_PROCHEAD && df->df_type != error_type) {
/* We already saw a definition of this type
in the definition module.
*/
+ assert(df->df_type != 0);
+
if (!TstProcEquiv(tp, df->df_type)) {
error("inconsistent procedure declaration for \"%s\"",
df->df_idf->id_text);