From 6297085f09c4147eea16bba00455d240a3a95496 Mon Sep 17 00:00:00 2001 From: reuk Date: Wed, 22 Nov 2017 10:33:38 +0000 Subject: [PATCH] Fix iterator comparison bug in expr_iterator --- src/util/expr_iterator.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/util/expr_iterator.h b/src/util/expr_iterator.h index be228bcfba4..3fa9ee89860 100644 --- a/src/util/expr_iterator.h +++ b/src/util/expr_iterator.h @@ -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.