Skip to content

Bugfix rewrite_with_to_field_symbols #4832

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

romainbrenguier
Copy link
Contributor

This fix the case where USE_UPDATE is not defined, and replace the ifdef by a template argument, so that it could be tested for both cases.

  • Each commit message has a non-empty body, explaining why the change was made.
  • [na] Methods or procedures I have added are documented, following the guidelines provided in CODING_STANDARD.md.
  • 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).
  • [na] My commit message includes data points confirming performance improvements (if claimed).
  • My PR is restricted to a single feature or bugfix.
  • [na] White-space or formatting changes outside the feature-related changed lines are in commits of their own.

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: a1f2f32).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/116615574


if(field_sensitive_lhs.id() != ID_symbol)
break;
state.field_sensitivity.apply(ns, state, field_sensitive_lhs, true);
Copy link
Contributor

Choose a reason for hiding this comment

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

apply gains an argument in the wrong (first) commit

@@ -450,7 +455,12 @@ void goto_symext::symex_assign_symbol(
// in the future these should be omitted.
auto assignment = shift_indexed_access_to_lhs(
state, assignmentt{lhs, std::move(l2_rhs)}, ns, symex_config.simplify_opt);
assignment = rewrite_with_to_field_symbols(state, std::move(assignment), ns);
assignment =
#ifdef USE_UPDATE
Copy link
Contributor

Choose a reason for hiding this comment

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

Introduce an auxiliary function like inline bool use_update() { #ifdef USE_UPDATE return true; #else return false; #endif }?

while(assignment.rhs.id() == ID_with &&
to_with_expr(assignment.rhs).operands().size() == 3 &&
(lhs_mod.type().id() == ID_array ||
lhs_mod.type().id() == ID_struct ||
Copy link
Contributor

Choose a reason for hiding this comment

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

Reformat in wrong commit

@@ -250,7 +250,8 @@ static assignmentt rewrite_with_to_field_symbols(
update.new_value().type());
}

state.field_sensitivity.apply(ns, state, field_sensitive_lhs, true);
field_sensitive_lhs = state.field_sensitivity.apply(
Copy link
Contributor

Choose a reason for hiding this comment

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

!!! Test for this fix? Also mention in the commit message that this is actually a bugfix (or fix it in a separate commit?)

@romainbrenguier romainbrenguier force-pushed the clean-up/rewrite-with-to-field-symbols-1 branch from a1f2f32 to 538b735 Compare June 24, 2019 12:43
@codecov-io
Copy link

codecov-io commented Jun 24, 2019

Codecov Report

Merging #4832 (28d6848) into develop (ea5adcc) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff            @@
##           develop    #4832   +/-   ##
========================================
  Coverage    69.67%   69.67%           
========================================
  Files         1248     1248           
  Lines       100836   100836           
========================================
  Hits         70262    70262           
  Misses       30574    30574           
Flag Coverage Δ
cproversmt2 43.42% <ø> (ø)
regression 66.65% <ø> (ø)
unit 32.20% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
src/goto-symex/field_sensitivity.h 100.00% <ø> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ea5adcc...28d6848. Read the comment docs.

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: 538b735).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/116647352

@romainbrenguier romainbrenguier force-pushed the clean-up/rewrite-with-to-field-symbols-1 branch 2 times, most recently from 5cb2fd6 to 2282957 Compare June 26, 2019 06:55
@romainbrenguier romainbrenguier changed the title Clean-up rewrite_with_to_field_symbols Bugfix rewrite_with_to_field_symbols Jun 26, 2019
@romainbrenguier
Copy link
Contributor Author

I've extracted the ifdef/template refactoring to a new PR #4840, in order to only keep here the bugfix and add unit test to it.

@romainbrenguier romainbrenguier force-pushed the clean-up/rewrite-with-to-field-symbols-1 branch from 2282957 to 62fdd80 Compare September 23, 2019 10:34
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: 62fdd80).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/128747800

@tautschnig
Copy link
Collaborator

@romainbrenguier Would you mind rebasing so that this change can be merged?

Not using the result is certainly a bug, so we mark it as NODISCARD.
@romainbrenguier romainbrenguier force-pushed the clean-up/rewrite-with-to-field-symbols-1 branch from 62fdd80 to 28d6848 Compare January 20, 2021 09:23
@romainbrenguier
Copy link
Contributor Author

@tautschnig

@romainbrenguier Would you mind rebasing so that this change can be merged?

done

@tautschnig tautschnig merged commit d613b01 into diffblue:develop Jan 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants