Skip to content

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

Merged
merged 1 commit into from
Aug 15, 2019
Merged

Conversation

kroening
Copy link
Member

This improves type safety.

  • Each commit message has a non-empty body, explaining why the change was made.
  • n/a Methods or procedures I have added are documented, following the guidelines provided in CODING_STANDARD.md.
  • n/a The feature or user visible behaviour I have added or modified has been documented in the User Guide in doc/cprover-manual/
  • Regression or unit tests are included, or existing tests cover the modified code (in this case I have detailed which ones those are in the commit message).
  • n/a My commit message includes data points confirming performance improvements (if claimed).
  • n/a My PR is restricted to a single feature or bugfix.
  • n/a White-space or formatting changes outside the feature-related changed lines are in commits of their own.

@@ -110,7 +110,7 @@ void goto_program2codet::scan_for_varargs()
to_side_effect_expr(r).get_statement() == ID_va_start)
{
assert(r.has_operands());

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)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed

@@ -41,7 +41,7 @@ class dott

unsigned subgraphscount;

std::list<exprt> function_calls;
std::list<binary_exprt> function_calls;

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?

Copy link
Member Author

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.

Copy link
Contributor

@allredj allredj left a 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.
@kroening kroening force-pushed the opX-goto-instrument branch from 7a76092 to 494728d Compare August 13, 2019 12:55
@@ -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()});
Copy link
Contributor

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

Copy link
Contributor

@allredj allredj left a 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

@kroening kroening merged commit a9ed380 into develop Aug 15, 2019
@kroening kroening deleted the opX-goto-instrument branch August 15, 2019 09:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants