-
Notifications
You must be signed in to change notification settings - Fork 274
Remove goto_programt::instructiont::type_nonconst #6419
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
(goto_program_instruction_typet)irepconverter.read_gb_word(in), | ||
static_cast<const exprt &>(irepconverter.reference_convert(in)), | ||
{}}; | ||
|
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.
The order of evaluation of function arguments is unspecified in C++ -- i.e., this may read the entries of the binary in the wrong order.
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.
Fixed!
back_edge->type_nonconst() = GOTO; | ||
instructions.emplace_back( | ||
goto_programt::make_goto(loop_head, back_edge_location)); | ||
loop_head->incoming_edges.insert(--instructions.end()); |
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.
I'd use std::prev
here, given that the side effect of the predecrement operator is not used.
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.
Done.
cd12c87
to
a05ab76
Compare
Use of this method was never advised, and the remaining two uses can be rewritten to use more appropriate (and modern) APIs.
a05ab76
to
f6fa03c
Compare
Codecov Report
@@ Coverage Diff @@
## develop #6419 +/- ##
===========================================
- Coverage 75.99% 75.98% -0.01%
===========================================
Files 1524 1524
Lines 164300 164299 -1
===========================================
- Hits 124854 124843 -11
- Misses 39446 39456 +10
Continue to review full report at Codecov.
|
Use of this method was never advised, and the remaining two uses can be
rewritten to use more appropriate (and modern) APIs.