-
Notifications
You must be signed in to change notification settings - Fork 274
Simplify byte-extract from struct or union expressions #5873
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
c0f4668
to
a6f29ba
Compare
Codecov Report
@@ Coverage Diff @@
## develop #5873 +/- ##
===========================================
+ Coverage 75.33% 75.53% +0.20%
===========================================
Files 1447 1447
Lines 157988 158116 +128
===========================================
+ Hits 119013 119437 +424
+ Misses 38975 38679 -296
Continue to review full report at Codecov.
|
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.
This feels like the kind of thing that could have or acquire subtle bugs. Would it be possible to add a test case or two? It feels like 100% patch coverage is possible and might be worth having.
a6f29ba
to
faa02d4
Compare
Indeed, test added. |
Thanks. |
faa02d4
to
971178b
Compare
971178b
to
b3985eb
Compare
b3985eb
to
c412a6b
Compare
c412a6b
to
033835a
Compare
033835a
to
1270713
Compare
With rewrite_union rewriting union accesses to byte-extract operations, simplifying such expressions must cover as many cases as possible. Constants were mostly already being rewritten via expr2bits, but that wouldn't be able to handle expressions involving pointers (even when they are effectively constants when using address-of operations). The additional simplification rules mimic what lower_byte_extract already did at a later stage, but such late rewrites would not benefit constant propagation done by goto-symex.
1270713
to
6544f7c
Compare
With rewrite_union introducing rewriting union accesses to byte-extract
operations, simplifying such expressions must cover as many cases as
possible. Constants were mostly already being rewritten via expr2bits,
but that wouldn't be able to handle expressions involving pointers (even
when they are effectively constants when using address-of operations).
The additional simplification rules mimic what lower_byte_extract
already did at a later stage, but such late rewrites would not benefit
constant propagation done by goto-symex.