Fixed bug: divide by 0
This commit is contained in:
parent
851efa7ffe
commit
a829777e65
|
@ -125,7 +125,7 @@ align(pos, al)
|
||||||
int i = pos % al;
|
int i = pos % al;
|
||||||
|
|
||||||
if (i) return pos + (al - i);
|
if (i) return pos + (al - i);
|
||||||
return pos;
|
return pos == 0 ? 1 : pos;
|
||||||
}
|
}
|
||||||
|
|
||||||
t_type *
|
t_type *
|
||||||
|
@ -384,6 +384,8 @@ subr_type(lb, ub, base)
|
||||||
*/
|
*/
|
||||||
if (! chk_bounds(lb->nd_INT, ub->nd_INT, tp->tp_fund)) {
|
if (! chk_bounds(lb->nd_INT, ub->nd_INT, tp->tp_fund)) {
|
||||||
node_error(lb, "lower bound exceeds upper bound");
|
node_error(lb, "lower bound exceeds upper bound");
|
||||||
|
ub->nd_INT = lb->nd_INT;
|
||||||
|
res->sub_ub = res->sub_lb;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (tp == card_type) {
|
if (tp == card_type) {
|
||||||
|
|
Loading…
Reference in a new issue