-
Notifications
You must be signed in to change notification settings - Fork 274
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
Conversation
0919108
to
0716bfd
Compare
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.
0716bfd
to
e0700db
Compare
Codecov Report
@@ Coverage Diff @@
## develop #5863 +/- ##
========================================
Coverage 72.89% 72.90%
========================================
Files 1423 1423
Lines 154229 154231 +2
========================================
+ Hits 112426 112441 +15
+ Misses 41803 41790 -13
Continue to review full report at Codecov.
|
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) |
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.
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.
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.
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 |
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: s/invalidate/invalidates/
This mirrors the change in #5861 by replacing the use of
code_returnt
bydirectly returning the return value expression. The client code is
simplified considerably.