Skip to content

bv2integer is now told the width #3100

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 3 commits into from
Oct 18, 2018
Merged

bv2integer is now told the width #3100

merged 3 commits into from
Oct 18, 2018

Conversation

kroening
Copy link
Member

@kroening kroening commented Oct 4, 2018

  • Each commit message has a non-empty body, explaining why the change was made.
  • My contribution is formatted in line with CODING_STANDARD.md.
  • Methods or procedures I have added are documented, following the guidelines provided in CODING_STANDARD.md.
  • 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).
  • My commit message includes data points confirming performance improvements (if claimed).
  • My PR is restricted to a single feature or bugfix.
  • 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: 5ab5772).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/86926808

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

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.

This PR failed Diffblue compatibility checks (cbmc commit: c89578a).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/87172948
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).

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

@kroening kroening mentioned this pull request Oct 17, 2018
7 tasks
Copy link
Collaborator

@tautschnig tautschnig left a comment

Choose a reason for hiding this comment

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

A couple of suggestions (trying out GitHub's new feature...) below. From the start, this PR would have benefitted quite a bit from commit messages answering the "why?" question. The answer to that has become clear through other PRs, but that delays reviewing significantly.

@@ -1811,9 +1811,10 @@ std::string expr2ct::convert_constant(
if(c_enum_type.id()!=ID_c_enum)
return convert_norep(src, precedence);

bool is_signed=c_enum_type.subtype().id()==ID_signedbv;
const bool is_signed = c_enum_type.subtype().id() == ID_signedbv;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Nit pick: Unrelated change?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, but we appear to do some, and not others!

Copy link
Collaborator

Choose a reason for hiding this comment

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

As a reviewer, the first question I usually ask myself is "why was this line changed" and expect to be able to immediately answer that to myself from the commit message. Sometimes there are additional changes in those lines beyond what's in the commit message. If those are of the nature "added in a const" or "fixed up whitespace" then those seem like desirable improvements. Everything else raises eyebrows and usually makes me post questions in here ;-)

int_value = bv2integer(id2string(value), width, false);
return false;
}
else if(subtype.id()==ID_c_bool)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Dare I say that a bugfix without accompanying test has been sneaked in?

Copy link
Member Author

Choose a reason for hiding this comment

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

Will make separate PR.

Copy link
Collaborator

@tautschnig tautschnig left a comment

Choose a reason for hiding this comment

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

One further change required as below, but otherwise looks good to me.

bv2integer(id2string(to_constant_expr(*it).get_value()), true));
mp_integer int_value;
if(to_integer(to_constant_expr(*it), int_value))
return true;
Copy link
Collaborator

Choose a reason for hiding this comment

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

The limitation of GitHub's suggestions feature (I have already provided feedback to them): my suggestion was meant to replace the entire bit of code, the lines above need to be removed now.

Copy link
Member Author

Choose a reason for hiding this comment

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

done.

@kroening kroening force-pushed the hex-bitvectors3 branch 2 times, most recently from 3487bbe to 36ebc8b Compare October 18, 2018 09:39
Daniel Kroening added 2 commits October 18, 2018 10:59
Direct access to the value of a constant_exprt is prone to error; the
already existing functions should be used instead.
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: 92f2621).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/88400326

@kroening kroening merged commit 954faed into develop Oct 18, 2018
@kroening kroening deleted the hex-bitvectors3 branch October 18, 2018 13:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants