From 73246f38248d3c8d79ec3200db410758c826099f Mon Sep 17 00:00:00 2001 From: ceriel Date: Mon, 21 Aug 1989 17:08:54 +0000 Subject: [PATCH] Improved checks for conversion between cardinal and integer --- lang/m2/comp/code.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/lang/m2/comp/code.c b/lang/m2/comp/code.c index bad650108..0a5af056e 100644 --- a/lang/m2/comp/code.c +++ b/lang/m2/comp/code.c @@ -643,12 +643,14 @@ RangeCheck(tpl, tpr) genrck(tpl); return; } - if (tpl->tp_size <= tpr->tp_size && - ((tpl->tp_fund == T_INTEGER && tpr == card_type) || - (tpr->tp_fund == T_INTEGER && tpl == card_type))) { + tpr = BaseType(tpr); + if ((tpl->tp_fund == T_INTEGER && tpr == card_type) || + (tpr->tp_fund == T_INTEGER && tpl == card_type)) { label lb = ++text_label; - C_dup(word_size); + C_dup(tpr->tp_size); + C_zer(tpr->tp_size); + C_cmi(tpr->tp_size); C_zge(lb); c_loc(ECONV); C_trp(); -- 2.34.1