-
Notifications
You must be signed in to change notification settings - Fork 274
Cleanup of throws and asserts of goto_convert.cpp #2905
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
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.
At the current state: please see #2814 for a number of blocking request.
eb1c4b9
to
7d0ba9f
Compare
7d0ba9f
to
a6c1699
Compare
a6c1699
to
3e57a9c
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: a6c1699).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/85897734
Status will be re-evaluated on next push.
Please contact @peterschrammel, @thk123, or @allredj for support.
Common spurious failures:
- 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).
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.
Passed Diffblue compatibility checks (cbmc commit: 3e57a9c).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/85899011
Remove duplicate invariants, and change some to transfer (cast) function calls, which provide guarantees about the data types by construction. Also substitute invariants with exceptions where appropriate.
3e57a9c
to
9a6e16f
Compare
@tautschnig This should be now in a state where it's ready for a review. Just a note: I have tried my best to make the commits as close as possible to the contribution guidelines. It's a little bit hairy, because 3 people have worked on this thus far, and one of them is no longer with us, but we have to be careful not to lose commit information and attribution information, hence why the commits are the way they are and I can not squash them better. |
@@ -0,0 +1,8 @@ | |||
CORE gcc-only |
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.
Why is this gcc-only?
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.
You're right, this is a mistake, both clang
and gcc
report the same error.
CORE | ||
main.c | ||
|
||
^EXIT=134$ |
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.
Huh? That's not what should be happening...
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.
What should be happening? I see that gcc
and clang
produce warnings that the range is empty, but are happy to compile nonetheless. Should I remove the invariant?
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.
We should be able to support whatever GCC and Clang do. 134 (a failing invariant) is not an exit code we should ever be producing for a syntactically valid C program.
src/goto-programs/goto_convert.cpp
Outdated
|
||
throw 0; | ||
} | ||
bool res = get_string_constant(expr, result); |
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.
const
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.
Passed Diffblue compatibility checks (cbmc commit: 9a6e16f).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/86143603
9a6e16f
to
5e7e55a
Compare
@tautschnig I decided on an alternative approach to the bugged test (the one we had a divergent behaviour from Before the refactoring work, that turned a line in |
Refactor a function in goto_convertt so that it becomes more comprehensible.
Change some data_invariants to invariants_with_diagnostics where they are more appropriate, and remove some duplicate invariants, where they are guaranteed by construction of the types themselves.
5e7e55a
to
5523818
Compare
I pushed #3055 that fixes this the issue suggested above. That PR also for now contains the changes introduced here, but once this one is merged, I will rebase that one appropriately to only mirror the change it introduces. |
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: 5e7e55a).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/86177330
Status will be re-evaluated on next push.
Please contact @peterschrammel, @thk123, or @allredj for support.
Common spurious failures:
- 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).
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.
Passed Diffblue compatibility checks (cbmc commit: 5523818).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/86177840
In the same spirit as #2904 I am taking over development of #2814 because the original repository is now defunct, and I can't go further with that PR. This PR will host further development of that line of work.