From: George Koehler Date: Fri, 7 Sep 2012 19:53:13 +0000 (-0400) Subject: Fix cemcom.ansi for 64-bit hosts. X-Git-Tag: release-6-0-pre-5~43 X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=800d4ae032538885c213e89bc60e0ceed8dc1398;p=ack.git Fix cemcom.ansi for 64-bit hosts. Hosts with sizeof(arith) == sizeof(long) == 8 need to set full_mask[1] through full_mask[8]. Because MAXSIZE == 8, we only had full_mask[0] through full_mask[7]. This fix declares arith full_mask[MAXSIZE + 1] and prevents a fatal error: "array full_mask too small for this machine" --- diff --git a/lang/cem/cemcom.ansi/ch3mon.c b/lang/cem/cemcom.ansi/ch3mon.c index 41b277403..40cc44025 100644 --- a/lang/cem/cemcom.ansi/ch3mon.c +++ b/lang/cem/cemcom.ansi/ch3mon.c @@ -20,7 +20,7 @@ #include "sizes.h" extern char options[]; -extern arith full_mask[/*MAXSIZE*/]; /* cstoper.c */ +extern arith full_mask[/*MAXSIZE + 1*/]; /* cstoper.c */ char *symbol2str(); ch3mon(oper, expp) diff --git a/lang/cem/cemcom.ansi/ch7mon.c b/lang/cem/cemcom.ansi/ch7mon.c index ab3e38642..f7962904b 100644 --- a/lang/cem/cemcom.ansi/ch7mon.c +++ b/lang/cem/cemcom.ansi/ch7mon.c @@ -18,7 +18,7 @@ #include "def.h" extern char options[]; -extern arith full_mask[/*MAXSIZE*/]; /* cstoper.c */ +extern arith full_mask[/*MAXSIZE + 1*/]; /* cstoper.c */ char *symbol2str(); ch7mon(oper, expp) diff --git a/lang/cem/cemcom.ansi/cstoper.c b/lang/cem/cemcom.ansi/cstoper.c index ddd7bf68f..c86f122be 100644 --- a/lang/cem/cemcom.ansi/cstoper.c +++ b/lang/cem/cemcom.ansi/cstoper.c @@ -16,7 +16,8 @@ #include "Lpars.h" #include "assert.h" -arith full_mask[MAXSIZE];/* full_mask[1] == 0XFF, full_mask[2] == 0XFFFF, .. */ +/* full_mask[1] == 0XFF, full_mask[2] == 0XFFFF, .. */ +arith full_mask[MAXSIZE + 1]; #ifndef NOCROSS arith max_int; /* maximum integer on target machine */ arith max_unsigned; /* maximum unsigned on target machine */ @@ -247,7 +248,7 @@ init_cst() while (!(bt < 0)) { bt = (bt << 8) + 0377, i++; - if (i == MAXSIZE) + if (i > MAXSIZE) fatal("array full_mask too small for this machine"); full_mask[i] = bt; }