-
Notifications
You must be signed in to change notification settings - Fork 274
Fix distance check in overflow checking of left shift #6186
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
69834c1
to
ca7946e
Compare
ec75d1d
to
a54426c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes; we need this.
@@ -777,8 +777,10 @@ void goto_checkt::integer_overflow_check( | |||
if(distance_type.id() == ID_unsignedbv) | |||
neg_dist_shift = false_exprt(); | |||
else | |||
neg_dist_shift = | |||
binary_relation_exprt(op, ID_lt, from_integer(0, distance_type)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😱 oops.
The code wrongly compared the shift operand when checking against negative shifts.
a54426c
to
3d7b953
Compare
Codecov Report
@@ Coverage Diff @@
## develop #6186 +/- ##
===========================================
+ Coverage 67.40% 75.33% +7.92%
===========================================
Files 1157 1454 +297
Lines 95236 160922 +65686
===========================================
+ Hits 64197 121225 +57028
- Misses 31039 39697 +8658
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
The code wrongly compared the shift operand when checking against
negative shifts.