Skip to content

Commit 2a97368

Browse files
author
Daniel Kroening
authored
Merge pull request #3720 from diffblue/fix-compound-assignment-promotion
Fix compound assignment promotion
2 parents ad36687 + e78e7d1 commit 2a97368

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

regression/cbmc/Fixedbv1/main.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@ int main() {
55
int y;
66

77
x=2;
8-
x-=0.6;
8+
x -= (__CPROVER_fixedbv[64][32])0.6;
99
y=x; // this yields 1.4, which is cut off
1010

1111
assert(y==1);
1212

1313
x=2;
14-
x-=0.4;
14+
x -= (__CPROVER_fixedbv[64][32])0.4;
1515
y=x; // this yields 1.6, which is cut off, too!
1616

1717
assert(y==1);

regression/cbmc/compound-assignment/compound_promotion.desc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
KNOWNBUG
2-
compound_promition.c
1+
CORE
2+
compound_promotion.c
33

44
^EXIT=0$
55
^SIGNAL=0$

src/ansi-c/c_typecheck_expr.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3458,7 +3458,7 @@ void c_typecheck_baset::typecheck_side_effect_assignment(
34583458
}
34593459
else
34603460
{
3461-
implicit_typecast(op1, o_type0);
3461+
implicit_typecast_arithmetic(op0, op1);
34623462

34633463
if(is_number(op1.type()) ||
34643464
op1.type().id()==ID_bool ||

0 commit comments

Comments
 (0)