Cleanup of throws and asserts of goto_convert.cpp#2905
Cleanup of throws and asserts of goto_convert.cpp#2905tautschnig merged 5 commits intodiffblue:developfrom
Conversation
tautschnig
left a comment
There was a problem hiding this comment.
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
allredj
left a comment
There was a problem hiding this comment.
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).
allredj
left a comment
There was a problem hiding this comment.
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.
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.
Huh? That's not what should be happening...
There was a problem hiding this comment.
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.
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); |
allredj
left a comment
There was a problem hiding this comment.
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. |
allredj
left a comment
There was a problem hiding this comment.
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).
allredj
left a comment
There was a problem hiding this comment.
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.