check number of locals and parameters

This commit is contained in:
ceriel 1987-11-24 14:21:35 +00:00
parent ea2c86ef0c
commit b2824fe796
3 changed files with 7 additions and 1 deletions

View file

@ -1 +1 @@
static char Version[] = "ACK Modula-2 compiler Version 0.28"; static char Version[] = "ACK Modula-2 compiler Version 0.29";

View file

@ -399,6 +399,9 @@ proc_type(result_type, parameters, n_bytes_params)
tp->prc_params = parameters; tp->prc_params = parameters;
tp->prc_nbpar = n_bytes_params; tp->prc_nbpar = n_bytes_params;
if (! fit(n_bytes_params, (int) word_size)) {
error("maximum parameter byte count exceeded");
}
return tp; return tp;
} }

View file

@ -339,6 +339,9 @@ WalkProcedure(procedure)
C_ret(func_res_size); C_ret(func_res_size);
if (! options['n']) WalkDefList(sc->sc_def, RegisterMessage); if (! options['n']) WalkDefList(sc->sc_def, RegisterMessage);
C_end(-sc->sc_off); C_end(-sc->sc_off);
if (! fit(sc->sc_off, (int) word_size)) {
node_error(procedure->prc_body, "maximum local byte count exceeded");
}
TmpClose(); TmpClose();
CurrVis = savevis; CurrVis = savevis;
proclevel--; proclevel--;