From 9dbd7bdcf5a93f99429f3a09af10f9348a1e4632 Mon Sep 17 00:00:00 2001 From: ceriel Date: Fri, 15 Apr 1988 17:25:01 +0000 Subject: [PATCH] check for total size of locals and parameters --- lang/cem/cemcom/code.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lang/cem/cemcom/code.c b/lang/cem/cemcom/code.c index 6ccea0b96..1fb91cf69 100644 --- a/lang/cem/cemcom/code.c +++ b/lang/cem/cemcom/code.c @@ -283,6 +283,10 @@ end_proc(fbytes) C_beginpart(pro_id); C_pro(pro_name, nbytes); #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 */ if (sp_occurred[SP_SETJMP]) { /* indicate use of "setjmp" */ options['n'] = 1; @@ -294,6 +298,10 @@ end_proc(fbytes) #endif LocalFinish(); 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; } -- 2.34.1