-
Notifications
You must be signed in to change notification settings - Fork 274
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
Conversation
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.
20a0c6c
to
c4124b6
Compare
c4124b6
to
5ab5772
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.
Passed Diffblue compatibility checks (cbmc commit: 5ab5772).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/86926808
5ab5772
to
5eca685
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.
Passed Diffblue compatibility checks (cbmc commit: 5eca685).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/87137970
5eca685
to
c89578a
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: 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).
c89578a
to
8314f36
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.
Passed Diffblue compatibility checks (cbmc commit: 8314f36).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/87854314
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.
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.
jbmc/src/java_bytecode/java_bytecode_concurrency_instrumentation.cpp
Outdated
Show resolved
Hide resolved
@@ -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; |
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.
Nit pick: Unrelated change?
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.
Yes, but we appear to do some, and not others!
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.
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 ;-)
src/util/arith_tools.cpp
Outdated
int_value = bv2integer(id2string(value), width, false); | ||
return false; | ||
} | ||
else if(subtype.id()==ID_c_bool) |
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.
Dare I say that a bugfix without accompanying test has been sneaked in?
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.
Will make separate PR.
f62df2d
to
1f96e27
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.
One further change required as below, but otherwise looks good to me.
src/goto-programs/goto_convert.cpp
Outdated
bv2integer(id2string(to_constant_expr(*it).get_value()), true)); | ||
mp_integer int_value; | ||
if(to_integer(to_constant_expr(*it), int_value)) | ||
return true; |
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.
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.
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.
done.
1f96e27
to
f8e5542
Compare
3487bbe
to
36ebc8b
Compare
Direct access to the value of a constant_exprt is prone to error; the already existing functions should be used instead.
36ebc8b
to
9b96fd1
Compare
9b96fd1
to
92f2621
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.
Passed Diffblue compatibility checks (cbmc commit: 92f2621).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/88400326