-
Notifications
You must be signed in to change notification settings - Fork 277
Fix invalidation of CARs on free and DEAD instructions #6385
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
baa88bd
to
0b64870
Compare
0b64870
to
04d07a7
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.
With this modification the the conditional DEAD statement are correctly tracked using a condition embedded in the code rather than statically at compile time
Previously, corresponding CARs were completely removed on DEAD instructions. While this is "okay" for unconditionally dead symbols, it resulted in spurious non-assignable errors when symbols were only conditionally DEAD, e.g. RETURN within a conditional block. Previously, invalid CARs from free calls were simply left behind, because (in theory) the CAR validation condition should automatically guard against conditions. However, in both these cases, we need to check dead/deallocated status of individual objects to avoid spurious errors from CBMC's internal pointer checks, which only track a single dead/deallocated object nondeterministically.
04d07a7
to
998d141
Compare
Codecov Report
@@ Coverage Diff @@
## develop #6385 +/- ##
========================================
Coverage 75.92% 75.93%
========================================
Files 1518 1518
Lines 164007 164040 +33
========================================
+ Hits 124526 124565 +39
+ Misses 39481 39475 -6
Continue to review full report at Codecov.
|
throw incorrect_goto_program_exceptiont( | ||
"Found a `DEAD` variable without corresponding `DECL`!", | ||
instruction_it->source_location); |
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.
Nice! We should use this instead of throw 0
.
.symbol_expr(); | ||
write_set_validity_addrs.insert(object_validity_var_addr); | ||
|
||
alias_checking_instructions.add(goto_programt::make_decl( |
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.
Should we be concerned that there is no test covering this line?
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.
Most likely a false positive from Codecov. Other statements in the same loop are covered, and there is no break
or continue
in between.
Previously, corresponding CARs were completely removed on
DEAD
instructions. While this is "okay" for unconditionally dead symbols, it resulted in spurious non-assignable errors when symbols were conditionallyDEAD
, e.g.RETURN
within a conditional block.Previously, invalid CARs from
free
calls were simply left behind, because (in theory) the CAR validation condition should automatically guard against conditions.However, in both these cases, we need to check dead/deallocated status of individual objects to avoid spurious errors from CBMC's internal pointer checks. This PR fixes this.
The feature or user visible behaviour I have added or modified has been documented in the User Guide in doc/cprover-manual/My commit message includes data points confirming performance improvements (if claimed).