-
Notifications
You must be signed in to change notification settings - Fork 274
fix exprt::opX accesses in goto-instrument #5011
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
6dd3a09
to
7a76092
Compare
@@ -110,7 +110,7 @@ void goto_program2codet::scan_for_varargs() | |||
to_side_effect_expr(r).get_statement() == ID_va_start) | |||
{ | |||
assert(r.has_operands()); |
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 assertion is now unnecessary (to_unary_expr
already does this)
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.
removed
src/goto-instrument/dot.cpp
Outdated
@@ -41,7 +41,7 @@ class dott | |||
|
|||
unsigned subgraphscount; | |||
|
|||
std::list<exprt> function_calls; | |||
std::list<binary_exprt> function_calls; |
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.
Since this is specifically containing function calls, could this be a more specific type than binary_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.
I've made it a pair.
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: 7a76092).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/122972476
This improves type safety.
7a76092
to
494728d
Compare
@@ -315,7 +314,8 @@ goto_programt::const_targett goto_program2codet::convert_assign_varargs( | |||
{ | |||
code_function_callt f( | |||
symbol_exprt(ID_va_start, code_typet({}, empty_typet())), | |||
{this_va_list_expr, to_address_of_expr(skip_typecast(r.op0())).object()}); | |||
{this_va_list_expr, | |||
to_address_of_expr(skip_typecast(to_unary_expr(r).op())).object()}); |
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.
I'd say make an exprt for a va_start
or do nothing, the fake unary-op isn't really adding any safety
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: 494728d).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/122995092
This improves type safety.