Fix incorrect snapShot unsharing

This fixes #3020.
This commit is contained in:
Howard Hinnant
2019-08-08 11:51:20 -04:00
committed by Nik Bougalis
parent 4ff0f482c3
commit c699864c85

View File

@@ -74,7 +74,8 @@ SHAMap::snapShot (bool isMutable) const
newMap.root_ = root_;
newMap.backed_ = backed_;
if ((state_ != SHAMapState::Immutable) || !isMutable)
if ((state_ != SHAMapState::Immutable) ||
(newMap.state_ != SHAMapState::Immutable))
{
// If either map may change, they cannot share nodes
newMap.unshare ();