do not allow reals as case labels, check size of array's
This commit is contained in:
parent
067eace890
commit
ea2c86ef0c
|
@ -1 +1 @@
|
|||
static char Version[] = "ACK Modula-2 compiler Version 0.27";
|
||||
static char Version[] = "ACK Modula-2 compiler Version 0.28";
|
||||
|
|
|
@ -404,6 +404,9 @@ CaseLabels(t_type **ptp; register t_node **pnd;)
|
|||
ChkCompat(pnd, *ptp, "case label");
|
||||
}
|
||||
nd = *pnd;
|
||||
if (! (nd->nd_type->tp_fund & T_DISCRETE)) {
|
||||
node_error(nd, "illegal type in case label");
|
||||
}
|
||||
}
|
||||
[
|
||||
UPTO { *pnd = nd = dot2node(Link,nd,NULLNODE);
|
||||
|
|
|
@ -538,6 +538,9 @@ ArraySizes(tp)
|
|||
diff = hi - lo;
|
||||
|
||||
tp->tp_size = (diff + 1) * tp->arr_elsize;
|
||||
if (! fit(tp->tp_size, (int) word_size)) {
|
||||
error("array too large");
|
||||
}
|
||||
|
||||
/* generate descriptor and remember label.
|
||||
*/
|
||||
|
|
Loading…
Reference in a new issue