-
Notifications
You must be signed in to change notification settings - Fork 274
[TG-9400][UFC] Add an assume-no-exceptions-thrown option #5117
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
[TG-9400][UFC] Add an assume-no-exceptions-thrown option #5117
Conversation
da9ea98
to
6f13cc5
Compare
c31ece6
to
ebe53cd
Compare
I note this doesn't quite do what it says: it actually asserts that no exception is thrown, rather than assuming it (TG of course also uses --cover, translating that into an assumption) |
It actually does both if I'm not mistaken. Should we rename the option to |
755de11
to
e5ba652
Compare
Codecov Report
@@ Coverage Diff @@
## develop #5117 +/- ##
===========================================
- Coverage 66.97% 66.96% -0.01%
===========================================
Files 1146 1146
Lines 93736 93721 -15
===========================================
- Hits 62778 62761 -17
- Misses 30958 30960 +2
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 PR failed Diffblue compatibility checks (cbmc commit: e5ba652).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/128707994
Status will be re-evaluated on next push.
Common spurious failures include: the cbmc commit has disappeared in the mean time (e.g. in a force-push); the author is not in the list of contributors (e.g. first-time contributors); compatibility was already broken by an earlier merge.
Yes I think that's better (the assert/assume pattern matches what the Java frontend does for null-pointer derefs for example) |
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.
lgtm
613b639
to
2d4842f
Compare
@@ -150,6 +154,56 @@ class lazy_class_to_declared_symbols_mapt | |||
std::unordered_multimap<irep_idt, symbolt> map; | |||
}; | |||
|
|||
struct java_bytecode_language_optionst | |||
{ | |||
explicit java_bytecode_language_optionst( |
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.
explicit not required
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 PR failed Diffblue compatibility checks (cbmc commit: 2d4842f).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/128776632
Status will be re-evaluated on next push.
Common spurious failures include: the cbmc commit has disappeared in the mean time (e.g. in a force-push); the author is not in the list of contributors (e.g. first-time contributors); compatibility was already broken by an earlier merge.
36b605c
to
6990f9b
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.
This PR failed Diffblue compatibility checks (cbmc commit: 6990f9b).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/129047220
Status will be re-evaluated on next push.
Common spurious failures include: the cbmc commit has disappeared in the mean time (e.g. in a force-push); the author is not in the list of contributors (e.g. first-time contributors); compatibility was already broken by an earlier merge.
Extract java_bytecode_language_optionst class from java_bytecode_language class, to make it more structured by separating the fields that are expected to remain constant during the execution once they are initialized.
This is to specify that we want to replace all throw instructions by assert false. This is useful mainly for performance reasons as it simplifies conditions for symex, while retaining the non-exceptional behaviour of the program.
This tests the option behaves as desired.
Test that when both are combined, --throw-runtime-exception still works.
6990f9b
to
b433f5c
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.
This PR failed Diffblue compatibility checks (cbmc commit: b433f5c).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/129121599
Status will be re-evaluated on next push.
Common spurious failures include: the cbmc commit has disappeared in the mean time (e.g. in a force-push); the author is not in the list of contributors (e.g. first-time contributors); compatibility was already broken by an earlier merge.
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.
QA is satisfied with this PR
This adds an option to JBMC to replace throw instructions by
assert(false);assume(false);
so that execution branches are not analyzed further than the first
throw
.This is mostly useful for performances, but the full benefit of this will only show once #5097 is in.