Assign variables for all parameters#823
Merged
kroening merged 1 commit intodiffblue:masterfrom May 18, 2017
Merged
Conversation
tautschnig
reviewed
Apr 13, 2017
Collaborator
tautschnig
left a comment
There was a problem hiding this comment.
A minor re-arrangement in the code, but mostly I'm concerned about the commit message: it may be a useful hint for reviewers, but much less so for anyone looking at git log at a future date. You are largely following the guidelines of "The seven rules of a great Git commit message", but fully reading https://chris.beams.io/posts/git-commit/ may reveal that "Assign variables for all parameters" has a few shortcomings. In particular: what is the context, which variables, which parameters?
Collaborator
There was a problem hiding this comment.
To apply RAII:
exprt rhs=type.id()==ID_c_bool?
get_nondet_bool(type):
side_effect_expr_nondett(type);
code_assignt assign(expr, rhs);
assign.add_source_location()=loc;
48e9587 to
96b3082
Compare
Contributor
Author
|
I've made both changes |
Collaborator
|
Looks good to me, thanks for all the changes! (Can't set approval from my mobile.) |
peterschrammel
approved these changes
Apr 13, 2017
Collaborator
|
Needs rebase. |
96b3082 to
61880d7
Compare
Contributor
Author
|
I've rebased. |
This was referenced Apr 20, 2017
61880d7 to
ebaf0c5
Compare
Previously, we would output code like this:
INPUT("arg0i", NONDET(int));
helloworld.fun:(I)I(NONDET(int));
We now output code like this instead:
tmp_object_factory$1 = NONDET(int);
INPUT("arg0i", tmp_object_factory$1);
helloworld.fun:(I)I(tmp_object_factory$1);
This means that the correct value of the argument to helloworld() is
picked up. It also simplifies the code, as we now use the machinery
built to deal with pointers for all types, with just a minor tweak for
booleans.
ebaf0c5 to
c34be32
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The pointer code is well suited to handle all types, not just pointers,
with just a minor tweak for booleans.
This has already been merged into the test-gen-support branch.