Skip to content

Commit 8dc57bc

Browse files
committed
Fix bug in move assignment operator.
1 parent a7d36a0 commit 8dc57bc

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

ChangeLog

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
2020-11-07 Kasper Peeters <[email protected]>
2+
3+
* Release 3.16
4+
5+
* Fix error in move assignment operator which caused tree
6+
corruptioin (thanks to Trevor Hickey for reporting the bug).
7+
18
2020-10-26 Kasper Peeters <[email protected]>
29

310
* Release 3.15
@@ -6,7 +13,7 @@
613
of calling them directly.
714

815
* Make `parent` throw an exception rather than bailing out with an
9-
assert.
16+
assert.
1017

1118
2019-09-21 Kasper Peeters <[email protected]>
1219

src/tree.hh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99

1010
/** \mainpage tree.hh
1111
\author Kasper Peeters
12-
\version 3.15
13-
\date 26-Nov-2020
12+
\version 3.16
13+
\date 07-Nov-2020
1414
\see http://tree.phi-sci.com/
1515
\see http://github.com/kpeeters/tree.hh/
1616
@@ -637,7 +637,7 @@ tree<T,tree_node_allocator>& tree<T, tree_node_allocator>::operator=(tree<T, tre
637637
clear(); // clear any existing data.
638638

639639
head->next_sibling=x.head->next_sibling;
640-
feet->prev_sibling=x.head->prev_sibling;
640+
feet->prev_sibling=x.feet->prev_sibling;
641641
x.head->next_sibling->prev_sibling=head;
642642
x.feet->prev_sibling->next_sibling=feet;
643643
x.head->next_sibling=x.feet;

0 commit comments

Comments
 (0)