version with better overflow checking

This commit is contained in:
ceriel
1987-11-26 14:15:24 +00:00
parent 900e979035
commit 896fec3fc5
9 changed files with 368 additions and 113 deletions

View File

@@ -404,7 +404,8 @@ CaseLabels(t_type **ptp; register t_node **pnd;)
ChkCompat(pnd, *ptp, "case label");
}
nd = *pnd;
if (! (nd->nd_type->tp_fund & T_DISCRETE)) {
if (! (nd->nd_type->tp_fund & T_DISCRETE) ||
nd->nd_type->tp_size > word_size) {
node_error(nd, "illegal type in case label");
}
}