-
Notifications
You must be signed in to change notification settings - Fork 277
Cleanup throws in irep (de)serialization #2960
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
Cleanup throws in irep (de)serialization #2960
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.
Passed Diffblue compatibility checks (cbmc commit: c8d7718).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/84845938
@@ -95,8 +96,7 @@ void irep_serializationt::read_irep( | |||
|
|||
if(in.get()!=0) | |||
{ | |||
std::cerr << "irep not terminated\n"; | |||
throw 0; | |||
throw deserialization_exceptiont("irep not terminated"); |
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.
Where is this caught?
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.
Good catch (no pun intended) I'd forgotten about that (I originally introduced something like a cprover_exception_baset
and caught that, but then decided against it as I didn't find it saved that much effort compared to not having it...)
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.
@peterschrammel This is now sorted with #2996
b04c67c
to
54d5487
Compare
src/util/exception_utils.h
Outdated
@@ -33,4 +33,23 @@ class invalid_user_input_exceptiont | |||
std::string what() const noexcept; | |||
}; | |||
|
|||
class system_exceptiont |
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.
Please add comments: when should this be used, i.e., what is (or isn't) a "system" exception.
src/util/exception_utils.h
Outdated
@@ -52,4 +52,13 @@ class system_exceptiont | |||
} | |||
}; | |||
|
|||
class deserialization_exceptiont |
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.
See other PR: this should likely derive from some common invalid-input exception base class.
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: b04c67c).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/85131105
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: 54d5487).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/85132310
54d5487
to
9373209
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.
Passed Diffblue compatibility checks (cbmc commit: 9373209).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/85576436
No description provided.