Skip to content

Commit f28be11

Browse files
committed
fix(avl_array): avoid iterator increment over end()
1 parent 3e53525 commit f28be11

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

avl_array.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,10 @@ class avl_array
108108
// preincrement
109109
const tag_avl_array_iterator& operator++()
110110
{
111+
// end reached?
112+
if (idx_ >= Size) {
113+
return *this;
114+
}
111115
// take left most child of right child, if not existent, take parent
112116
size_type i = instance_.child_[idx_].right;
113117
if (i != instance_.INVALID_IDX) {

0 commit comments

Comments
 (0)