From: ceriel Date: Mon, 23 Nov 1987 13:48:09 +0000 (+0000) Subject: fixed a bug: casts to short or char did not work right X-Git-Tag: release-5-5~3715 X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=70403f62d91bec7455e37580ec274431c64aaff6;p=ack.git fixed a bug: casts to short or char did not work right --- diff --git a/lang/cem/cemcom/conversion.c b/lang/cem/cemcom/conversion.c index f832f1898..7013771d6 100644 --- a/lang/cem/cemcom/conversion.c +++ b/lang/cem/cemcom/conversion.c @@ -102,6 +102,21 @@ conversion(from_type, to_type) default: crash("(conversion) illegal type conversion"); } + if (to_type->tp_size < word_size +#ifndef NOFLOAT + && to_fund != T_FLOATING +#endif NOFLOAT + ) { + extern long full_mask[]; + + C_loc((arith) full_mask[(int)(to_type->tp_size)]); + C_and(word_size); + if (to_fund == T_SIGNED) { + C_loc(to_type->tp_size); + C_loc(word_size); + C_cii(); + } + } } /* fundamental() returns in which category a given type falls: