Skip to content

Commit

Permalink
Fix iterator comparison bug in expr_iterator
Browse files Browse the repository at this point in the history
  • Loading branch information
reuk committed Nov 24, 2017
1 parent af314f5 commit 6297085
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/util/expr_iterator.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,10 @@ struct depth_iterator_expr_statet final
inline bool operator==(
const depth_iterator_expr_statet &left,
const depth_iterator_expr_statet &right)
{ return left.it==right.it && left.expr.get()==right.expr.get(); }
{
return distance(left.it, left.end) == distance(right.it, right.end) &&
left.expr.get() == right.expr.get();
}

/// Depth first search iterator base - iterates over supplied expression
/// and all its operands recursively.
Expand Down

0 comments on commit 6297085

Please sign in to comment.