From: erikb Date: Tue, 9 Sep 1986 09:47:43 +0000 (+0000) Subject: corrected the compile-time evaluation of ~ X-Git-Tag: release-5-5~5233 X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=d7716c5e5a83deab2ba08bf2b4df51d4ed6b6bc0;p=ack.git corrected the compile-time evaluation of ~ --- diff --git a/lang/cem/cemcom/ch7mon.c b/lang/cem/cemcom/ch7mon.c index 64b3170ed..2d6332469 100644 --- a/lang/cem/cemcom/ch7mon.c +++ b/lang/cem/cemcom/ch7mon.c @@ -13,6 +13,7 @@ #include "def.h" extern char options[]; +extern long full_mask[/*MAXSIZE*/]; /* cstoper.c */ char *symbol2str(); ch7mon(oper, expp) @@ -99,13 +100,18 @@ ch7mon(oper, expp) erroneous2int(expp); break; } - /* FALL THROUGH */ + /* FALLTHROUGH */ } case '-': any2arith(expp, oper); if (is_cp_cst(*expp)) { arith o1 = (*expp)->VL_VALUE; - (*expp)->VL_VALUE = (oper == '-') ? -o1 : ~o1; + + (*expp)->VL_VALUE = (oper == '-') ? -o1 : + ((*expp)->ex_type->tp_unsigned ? + (~o1) & full_mask[(*expp)->ex_type->tp_size] : + ~o1 + ); } else if (is_fp_cst(*expp))