-
Notifications
You must be signed in to change notification settings - Fork 273
Extract call_stackt class from goto_symex_statet [depends-on: #4294] #4302
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
Extract call_stackt class from goto_symex_statet [depends-on: #4294] #4302
Conversation
a3d0090
to
89dfb92
Compare
The change to |
89dfb92
to
668f7f9
Compare
sorry staged by mistake |
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.
Minor comments.
symex_targett::sourcet calling_location; | ||
|
||
goto_programt::const_targett end_of_function; | ||
exprt return_value = nil_exprt(); |
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 do not initialise members outside of constructors, unless they are static 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.
Why not? This avoids having to repeat the same code for each constructor (and can avoid having to define a constructor in some cases).
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.
Because it violates the Single Responsibility Principle. Unless you have a very good (architectural) reason, it's only the constructor's job to construct and initialise an object. Makes the code much more predictable as well. But that's my opinion.
88e4833
to
9f29a30
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.
Seems sensible
Having one class per header file makes it easier to navigate the code and find what we want.
Having one class per file makes it easier to navigate the code and find what you want.
Extract a call_stackt class from goto_symex_statet to declutter the class definition. This makes some calls a bit more verbose, but can be clearer. For instance, it is not obvious what `top()` represent in the context of goto_symex_state, whereas `call_stack().top()` is more explicit.
No functional change
Guarantee that it is never called on an empty stack.
9f29a30
to
52eb5c7
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: 52eb5c7).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/103006835
Status will be re-evaluated on next push.
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).
-
the compatibility was already broken by an earlier merge.
Move goto_statet and framet to their own files [blocks: #4302]
No functional changes.
This is based on #4294
Extract a
call_stackt
class fromgoto_symex_statet
to declutter theclass definition.
This makes some calls a bit more verbose, but can be clearer.
For instance, it is not obvious what
top()
represent in the context ofgoto_symex_state, whereas
call_stack().top()
is more explicit.