Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 1 addition & 6 deletions src/frontc/cabs2cil.ml
Original file line number Diff line number Diff line change
Expand Up @@ -4009,12 +4009,7 @@ and doExp (asconst: bool) (* This expression is used as a constant *)
let (se, e', t) = doExp asconst e (AExp None) in
if isIntegralType t then
let tres = integralPromotion t in
let fallback = UnOp(Neg, makeCastT ~kind:IntegerPromotion ~e:e' ~oldt:t ~newt:tres, tres) in
let e'' =
match e', tres with
| Const(CInt(i, _, _)), TInt(ik, _) -> const_if_not_overflow fallback ik (neg_cilint i)
| _ -> fallback
in
let e'' = UnOp(Neg, makeCastT ~kind:IntegerPromotion ~e:e' ~oldt:t ~newt:tres, tres) in
finishExp se e'' tres
else
if isArithmeticType t then
Expand Down