From: ceriel Date: Mon, 11 Jan 1988 14:06:20 +0000 (+0000) Subject: prevent a voluntary crash and generate better code X-Git-Tag: release-5-5~3667 X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=897b86cba29e00d3652b05d09804cb5699f47e2c;p=ack.git prevent a voluntary crash and generate better code --- diff --git a/lang/cem/cemcom/conversion.c b/lang/cem/cemcom/conversion.c index 7013771d6..614ebfefa 100644 --- a/lang/cem/cemcom/conversion.c +++ b/lang/cem/cemcom/conversion.c @@ -109,13 +109,15 @@ conversion(from_type, to_type) ) { 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(); } + else { + C_loc((arith) full_mask[(int)(to_type->tp_size)]); + C_and(word_size); + } } } diff --git a/lang/cem/cemcom/declar.g b/lang/cem/cemcom/declar.g index e2332005c..2288d61d8 100644 --- a/lang/cem/cemcom/declar.g +++ b/lang/cem/cemcom/declar.g @@ -177,6 +177,7 @@ initializer(struct idf *idf; int sc;) : { if (idf->id_def->df_type->tp_fund == FUNCTION) { error("illegal initialization of function"); + idf->id_def->df_type->tp_fund = ERRONEOUS; } } [