From a829777e6557b1677c2cc7f056df5f578a5c3f26 Mon Sep 17 00:00:00 2001 From: ceriel Date: Mon, 9 Nov 1992 10:14:47 +0000 Subject: [PATCH] Fixed bug: divide by 0 --- lang/m2/comp/type.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lang/m2/comp/type.c b/lang/m2/comp/type.c index 045123540..50313983f 100644 --- a/lang/m2/comp/type.c +++ b/lang/m2/comp/type.c @@ -125,7 +125,7 @@ align(pos, al) int i = pos % al; if (i) return pos + (al - i); - return pos; + return pos == 0 ? 1 : pos; } t_type * @@ -384,6 +384,8 @@ subr_type(lb, ub, base) */ if (! chk_bounds(lb->nd_INT, ub->nd_INT, tp->tp_fund)) { node_error(lb, "lower bound exceeds upper bound"); + ub->nd_INT = lb->nd_INT; + res->sub_ub = res->sub_lb; } if (tp == card_type) { -- 2.34.1