CaseCode(nd->nd_lab, ch, exit_label);
FreeCh(ch);
+ FreeNode(nd);
}
FreeCh(ch)
extern long
mach_long_sign; /* sign bit of the machine long */
-extern int
- mach_long_size; /* size of long on this machine == sizeof(long) */
extern arith
max_int, /* maximum integer on target machine */
wrd_bits, /* number of bits in a word */
#include "type.h"
long mach_long_sign; /* sign bit of the machine long */
-int mach_long_size; /* size of long on this machine == sizeof(long) */
long full_mask[MAXSIZE+1];/* full_mask[1] == 0xFF, full_mask[2] == 0xFFFF, .. */
arith max_int; /* maximum integer on the target machine */
arith min_int; /* mimimum integer on the target machin */
else if( remainder != 0 && remainder != ~full_mask[size] ||
(o1 & full_mask[size]) == 1 << (size * 8 - 1) ) {
/* integers in [-maxint .. maxint] */
- int nbits = (int) (mach_long_size - size) * 8;
+ int nbits = (int) (sizeof(long) - size) * 8;
/* overflow(expr); */
/* sign bit of o1 in sign bit of mach_long */
fatal("array full_mask too small for this machine");
full_mask[i] = bt;
}
- mach_long_size = i;
- mach_long_sign = 1 << (mach_long_size * 8 - 1);
- if( int_size > mach_long_size )
+ mach_long_sign = 1L << (sizeof(long) * 8 - 1);
+ if( int_size > sizeof(long) )
fatal("sizeof (long) insufficient on this machine");
- max_int = full_mask[int_size] & ~(1 << (int_size * 8 - 1));
+ max_int = full_mask[int_size] & ~(1L << (int_size * 8 - 1));
min_int = - max_int;
maxint_str = long2str(max_int, 10);
maxint_str = Salloc(maxint_str, (unsigned int) strlen(maxint_str));
- wrd_bits = 8 * word_size;
+ wrd_bits = 8 * (int) word_size;
if( !max_intset ) max_intset = wrd_bits - 1;
}
*/
{ open_scope(); }
ProcedureHeading(&nd, &tp) ';'
- { scl = CurrVis; close_scope(); }
+ { scl = CurrVis; close_scope(0); }
[
Directive
{ DoDirective(dot.TOK_IDF, nd, tp, scl, 0); }
#ifdef DBSYMTAB
if (options['g']) stb_string(df, D_PEND);
#endif /* DBSYMTAB */
- close_scope();
+ close_scope(1);
}
]
;
*/
{ open_scope(); }
FunctionHeading(&nd, &tp) ';'
- { scl = CurrVis; close_scope(); }
+ { scl = CurrVis; close_scope(0); }
[
Directive
{ if( !tp ) {
}
/* open_scope() is simulated in DeclFunc() */
- close_scope();
+ close_scope(1);
}
]
;
RECORD
{ open_scope(); /* scope for fields of record */
scope = CurrentScope;
- close_scope();
+ close_scope(0);
}
FieldList(scope, &size, &xalign, packed, &sel)
{ if( size == 0 ) {
register struct scope *sc = new_scope();
register struct scopelist *ls = new_scopelist();
- sc->sc_def = 0;
sc->sc_level = proclevel;
PervasiveScope = sc;
- ls->next = 0;
ls->sc_scope = PervasiveScope;
ls->sc_count = ++sccount;
CurrVis = ls;
CurrVis = ls;
}
-close_scope()
+close_scope(doclean)
{
/* When this procedure is called, the next visible scope is equal to
the statically enclosing scope
*/
+ register struct def *df;
assert(CurrentScope != 0);
+ df = CurrentScope->sc_def;
+ if (doclean) while (df) {
+ struct def *next = df->df_nextinscope;
+ remove_def(df);
+ df = next;
+ }
CurrVis = CurrVis->next;
}
%if( !options['s'] && !strcmp(dot.TOK_IDF->id_text, "assert") )
IDENT { line = LineNumber; }
Expression(&expp)
- { AssertStat(expp, line); }
+ { AssertStat(expp, line);
+ FreeNode(expp);
+ }
|
IDENT { pnd = MkLeaf(Name, &dot); }
[ %default
ds = InitDesig;
if( !err_occurred )
CodeExpr(nd, &ds, l1);
+ FreeNode(nd);
}
THEN
Statement { chk_labels(slevel + 1); }
ds = InitDesig;
if( !err_occurred )
CodeExpr(nd, &ds, repeatlb);
+ FreeNode(nd);
}
;
ds = InitDesig;
if( !err_occurred )
CodeExpr(nd, &ds, exitlb);
+ FreeNode(nd);
}
DO
Statement