check for total size of locals and parameters

This commit is contained in:
ceriel 1988-04-15 17:25:01 +00:00
parent 09ed33d12d
commit 9dbd7bdcf5

View file

@ -283,6 +283,10 @@ end_proc(fbytes)
C_beginpart(pro_id); C_beginpart(pro_id);
C_pro(pro_name, nbytes); C_pro(pro_name, nbytes);
#endif #endif
if (fbytes > max_int) {
error("%s has more than %ld parameter bytes",
pro_name, (long) max_int);
}
C_ms_par(fbytes); /* # bytes for formals */ C_ms_par(fbytes); /* # bytes for formals */
if (sp_occurred[SP_SETJMP]) { /* indicate use of "setjmp" */ if (sp_occurred[SP_SETJMP]) { /* indicate use of "setjmp" */
options['n'] = 1; options['n'] = 1;
@ -294,6 +298,10 @@ end_proc(fbytes)
#endif #endif
LocalFinish(); LocalFinish();
C_end(nbytes); C_end(nbytes);
if (nbytes > max_int) {
error("%s has more than %ld bytes of local variables",
pro_name, (long) max_int);
}
options['n'] = optionsn; options['n'] = optionsn;
} }