fix to constant unary minus

This commit is contained in:
ceriel 1989-05-31 12:42:56 +00:00
parent ced856c234
commit cc3459e5a8

View file

@ -111,10 +111,11 @@ ch7mon(oper, expp)
if (is_cp_cst(*expp)) {
arith o1 = (*expp)->VL_VALUE;
(*expp)->VL_VALUE = (oper == '-') ? -o1 :
o1 = (oper == '-') ? -o1 : ~o1;
(*expp)->VL_VALUE =
((*expp)->ex_type->tp_unsigned ?
(~o1) & full_mask[(*expp)->ex_type->tp_size] :
~o1
o1 & full_mask[(*expp)->ex_type->tp_size] :
o1
);
}
else