Skip to content

Commit 1a36667

Browse files
Merge branch 'develop' into copilot/fix-integer-promotion-bit-fields
2 parents bdeb604 + bf39f60 commit 1a36667

1 file changed

Lines changed: 2 additions & 7 deletions

File tree

src/frontc/cabs2cil.ml

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4047,13 +4047,8 @@ and doExp (asconst: bool) (* This expression is used as a constant *)
40474047
| A.UNARY(A.MINUS, e) ->
40484048
let (se, e', t) = doExp asconst e (AExp None) in
40494049
if isIntegralType t then
4050-
let tres = integralPromotionE e' t in
4051-
let fallback = UnOp(Neg, makeCastT ~kind:IntegerPromotion ~e:e' ~oldt:t ~newt:tres, tres) in
4052-
let e'' =
4053-
match e', tres with
4054-
| Const(CInt(i, _, _)), TInt(ik, _) -> const_if_not_overflow fallback ik (neg_cilint i)
4055-
| _ -> fallback
4056-
in
4050+
let tres = integralPromotion e' t in
4051+
let e'' = UnOp(Neg, makeCastT ~kind:IntegerPromotion ~e:e' ~oldt:t ~newt:tres, tres) in
40574052
finishExp se e'' tres
40584053
else
40594054
if isArithmeticType t then

0 commit comments

Comments
 (0)