-
Notifications
You must be signed in to change notification settings - Fork 273
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
Assign variables for all parameters #823
Conversation
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 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); | ||
} |
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.
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
I've made both changes |
Looks good to me, thanks for all the changes! (Can't set approval from my mobile.) |
Needs rebase. |
96b3082
to
61880d7
Compare
I've rebased. |
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
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.