Skip to content

Assign variables for all parameters #823

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

owen-mc-diffblue
Copy link
Contributor

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.

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 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?

else
{
assign.rhs()=side_effect_expr_nondett(type);
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

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;

@owen-mc-diffblue owen-mc-diffblue force-pushed the bugfix/java-parameter-declarations-master branch from 48e9587 to 96b3082 Compare April 13, 2017 11:23
@owen-mc-diffblue
Copy link
Contributor Author

I've made both changes

@tautschnig
Copy link
Collaborator

Looks good to me, thanks for all the changes! (Can't set approval from my mobile.)

@kroening
Copy link
Member

Needs rebase.

@owen-mc-diffblue owen-mc-diffblue force-pushed the bugfix/java-parameter-declarations-master branch from 96b3082 to 61880d7 Compare April 20, 2017 09:06
@owen-mc-diffblue
Copy link
Contributor Author

owen-mc-diffblue commented Apr 20, 2017

I've rebased.

@owen-mc-diffblue owen-mc-diffblue force-pushed the bugfix/java-parameter-declarations-master branch from 61880d7 to ebaf0c5 Compare April 28, 2017 11:15
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.
@owen-mc-diffblue owen-mc-diffblue force-pushed the bugfix/java-parameter-declarations-master branch from ebaf0c5 to c34be32 Compare May 16, 2017 16:09
@kroening kroening merged commit 0ff98e8 into diffblue:master May 18, 2017
@owen-mc-diffblue owen-mc-diffblue deleted the bugfix/java-parameter-declarations-master branch June 19, 2017 08:24
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.

4 participants