Skip to content

Commit f5ae411

Browse files
committed
Clean-up
This will be merged later if people agree with it / it fixes CI
1 parent 440eb97 commit f5ae411

File tree

2 files changed

+12
-17
lines changed

2 files changed

+12
-17
lines changed

src/goto-symex/goto_state.h

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -74,13 +74,6 @@ class goto_statet
7474
: guard(true_exprt(), guard_manager)
7575
{
7676
}
77-
78-
void move_from(goto_statet &&other_state)
79-
{
80-
level2 = std::move(other_state.level2);
81-
propagation = std::move(other_state.propagation);
82-
value_set = std::move(other_state.value_set);
83-
}
8477
};
8578

8679
#endif // CPROVER_GOTO_SYMEX_GOTO_STATE_H

src/goto-symex/symex_goto.cpp

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -211,11 +211,13 @@ void goto_symext::symex_goto(statet &state)
211211
framet::goto_state_listt &goto_state_list =
212212
state.call_stack().top().goto_state_map[new_state_pc];
213213

214-
// On an unconditional GOTO we don't need our state any more, as it will be
215-
// overwritten by merge_goto. Therefore we move it onto goto_state_list
216-
// instead of copying as usual.
214+
// On an unconditional GOTO we don't need our state, as it will be overwritten
215+
// by merge_goto. Therefore we move it onto goto_state_list instead of copying
216+
// as usual.
217217
if(new_guard.is_true())
218218
{
219+
// The move here only moves goto_statet, the base class of goto_symex_statet
220+
// and not the entire thing.
219221
goto_state_list.emplace_back(state.source, std::move(state));
220222

221223
symex_transition(state, state_pc, backward);
@@ -330,7 +332,7 @@ void goto_symext::merge_goto(
330332
{
331333
if(state.guard.is_false())
332334
{
333-
state.move_from(std::move(goto_state));
335+
static_cast<goto_statet&>(state) = std::move(goto_state);
334336
}
335337
else
336338
{
@@ -339,14 +341,14 @@ void goto_symext::merge_goto(
339341

340342
// merge value sets
341343
state.value_set.make_union(goto_state.value_set);
342-
}
343-
}
344344

345-
// adjust guard
346-
state.guard|=goto_state.guard;
345+
// adjust guard
346+
state.guard|=goto_state.guard;
347347

348-
// adjust depth
349-
state.depth=std::min(state.depth, goto_state.depth);
348+
// adjust depth
349+
state.depth=std::min(state.depth, goto_state.depth);
350+
}
351+
}
350352
}
351353

352354
/// Applies f to `(k, ssa, i, j)` if the first map maps k to (ssa, i) and

0 commit comments

Comments
 (0)