fix to constant unary minus
This commit is contained in:
parent
ced856c234
commit
cc3459e5a8
1 changed files with 4 additions and 3 deletions
|
@ -111,10 +111,11 @@ ch7mon(oper, expp)
|
||||||
if (is_cp_cst(*expp)) {
|
if (is_cp_cst(*expp)) {
|
||||||
arith o1 = (*expp)->VL_VALUE;
|
arith o1 = (*expp)->VL_VALUE;
|
||||||
|
|
||||||
(*expp)->VL_VALUE = (oper == '-') ? -o1 :
|
o1 = (oper == '-') ? -o1 : ~o1;
|
||||||
|
(*expp)->VL_VALUE =
|
||||||
((*expp)->ex_type->tp_unsigned ?
|
((*expp)->ex_type->tp_unsigned ?
|
||||||
(~o1) & full_mask[(*expp)->ex_type->tp_size] :
|
o1 & full_mask[(*expp)->ex_type->tp_size] :
|
||||||
~o1
|
o1
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in a new issue