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"
This commit is contained in:
parent
6ea172d0d9
commit
800d4ae032
|
@ -20,7 +20,7 @@
|
||||||
#include "sizes.h"
|
#include "sizes.h"
|
||||||
|
|
||||||
extern char options[];
|
extern char options[];
|
||||||
extern arith full_mask[/*MAXSIZE*/]; /* cstoper.c */
|
extern arith full_mask[/*MAXSIZE + 1*/]; /* cstoper.c */
|
||||||
char *symbol2str();
|
char *symbol2str();
|
||||||
|
|
||||||
ch3mon(oper, expp)
|
ch3mon(oper, expp)
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
#include "def.h"
|
#include "def.h"
|
||||||
|
|
||||||
extern char options[];
|
extern char options[];
|
||||||
extern arith full_mask[/*MAXSIZE*/]; /* cstoper.c */
|
extern arith full_mask[/*MAXSIZE + 1*/]; /* cstoper.c */
|
||||||
char *symbol2str();
|
char *symbol2str();
|
||||||
|
|
||||||
ch7mon(oper, expp)
|
ch7mon(oper, expp)
|
||||||
|
|
|
@ -16,7 +16,8 @@
|
||||||
#include "Lpars.h"
|
#include "Lpars.h"
|
||||||
#include "assert.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
|
#ifndef NOCROSS
|
||||||
arith max_int; /* maximum integer on target machine */
|
arith max_int; /* maximum integer on target machine */
|
||||||
arith max_unsigned; /* maximum unsigned on target machine */
|
arith max_unsigned; /* maximum unsigned on target machine */
|
||||||
|
@ -247,7 +248,7 @@ init_cst()
|
||||||
|
|
||||||
while (!(bt < 0)) {
|
while (!(bt < 0)) {
|
||||||
bt = (bt << 8) + 0377, i++;
|
bt = (bt << 8) + 0377, i++;
|
||||||
if (i == MAXSIZE)
|
if (i > MAXSIZE)
|
||||||
fatal("array full_mask too small for this machine");
|
fatal("array full_mask too small for this machine");
|
||||||
full_mask[i] = bt;
|
full_mask[i] = bt;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue