Skip to content

Commit 18656b2

Browse files
committed
Fix iterator equality check bug in graphml_witness.cpp
1 parent 60ef5aa commit 18656b2

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/goto-programs/graphml_witness.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ Author: Daniel Kroening
1818
#include <util/prefix.h>
1919
#include <util/ssa_expr.h>
2020

21+
#include <goto-programs/goto_program_template.h>
22+
2123
void graphml_witnesst::remove_l0_l1(exprt &expr)
2224
{
2325
if(expr.id()==ID_symbol)
@@ -241,10 +243,10 @@ void graphml_witnesst::operator()(const goto_tracet &goto_trace)
241243
continue;
242244
}
243245

244-
goto_tracet::stepst::const_iterator next=it;
245-
for(++next;
246-
next!=goto_trace.steps.end() &&
247-
(step_to_node[next->step_nr]==sink || it->pc==next->pc);
246+
auto next = std::next(it);
247+
for(; next != goto_trace.steps.end() &&
248+
(step_to_node[next->step_nr] == sink ||
249+
pointee_address_equalt{}(it->pc, next->pc)); // NOLINT
248250
++next)
249251
{
250252
// advance

0 commit comments

Comments
 (0)