Skip to content

introduce instructiont::return_value() #5863

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 1 commit into from
Feb 24, 2021
Merged

Conversation

kroening
Copy link
Member

This mirrors the change in #5861 by replacing the use of code_returnt by
directly returning the return value expression. The client code is
simplified considerably.

  • Each commit message has a non-empty body, explaining why the change was made.
  • Methods or procedures I have added are documented, following the guidelines provided in CODING_STANDARD.md.
  • n/a The feature or user visible behaviour I have added or modified has been documented in the User Guide in doc/cprover-manual/
  • 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).
  • n/a My commit message includes data points confirming performance improvements (if claimed).
  • My PR is restricted to a single feature or bugfix.
  • n/a White-space or formatting changes outside the feature-related changed lines are in commits of their own.

@kroening kroening force-pushed the goto_instruction_return branch 4 times, most recently from 0919108 to 0716bfd Compare February 24, 2021 14:24
This mirrors the change in #5861 by replacing the use of code_returnt by
directly returning the return value expression.  The client code is
simplified considerably.
@codecov
Copy link

codecov bot commented Feb 24, 2021

Codecov Report

Merging #5863 (0716bfd) into develop (4daa686) will increase coverage by 0.00%.
The diff coverage is 88.58%.

Impacted file tree graph

@@           Coverage Diff            @@
##           develop    #5863   +/-   ##
========================================
  Coverage    72.89%   72.90%           
========================================
  Files         1423     1423           
  Lines       154229   154231    +2     
========================================
+ Hits        112426   112441   +15     
+ Misses       41803    41790   -13     
Impacted Files Coverage Δ
...va_bytecode/java_replace_nondet/replace_nondet.cpp 82.60% <0.00%> (+0.88%) ⬆️
.../goto-instrument/goto_instrument_parse_options.cpp 58.20% <ø> (ø)
...rc/goto-instrument/goto_instrument_parse_options.h 100.00% <ø> (ø)
src/goto-programs/goto_convert_class.h 87.30% <ø> (ø)
src/pointer-analysis/goto_program_dereference.cpp 26.61% <0.00%> (+0.62%) ⬆️
src/goto-programs/goto_program.cpp 64.58% <25.00%> (+0.33%) ⬆️
src/analyses/goto_check.cpp 88.25% <50.00%> (-0.03%) ⬇️
src/goto-diff/goto_diff_parse_options.cpp 58.67% <75.00%> (ø)
src/goto-programs/goto_program.h 90.03% <80.00%> (+0.66%) ⬆️
src/goto-analyzer/goto_analyzer_parse_options.cpp 73.25% <90.90%> (ø)
... and 27 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a4c81ef...e0700db. Read the comment docs.

const code_returnt &ret_expr = to_code_return(inst.code);
if(ret_expr.return_value().id() == ID_side_effect)
const auto &return_value = inst.return_value();
if(return_value.id() == ID_side_effect)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Not for this PR: we need to re-consider whether "nondet" really should remain a "side effect." It'll eventually be the only side effect remaining in goto programs.

Copy link
Member Author

Choose a reason for hiding this comment

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

Agreed.

@@ -2013,22 +2013,18 @@ void goto_checkt::goto_check(
}
else if(i.is_return())
{
if(i.code.operands().size()==1)
check(i.return_value());
// the return value invalidate any assertion
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: s/invalidate/invalidates/

@tautschnig tautschnig assigned kroening and unassigned tautschnig Feb 24, 2021
@peterschrammel peterschrammel removed their assignment Feb 24, 2021
@kroening kroening merged commit af80324 into develop Feb 24, 2021
@kroening kroening deleted the goto_instruction_return branch February 24, 2021 20:58
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.

3 participants