make sure setArray isn't copying mapped data addresses by accident in unionInPlace

This commit is contained in:
Seebs 2020-02-07 12:39:31 -06:00 committed by Matt Jaffee
parent 99d865c2ea
commit 7841a660a8
No known key found for this signature in database
GPG key ID: 08A3DFFF987B11BF

View file

@ -3779,7 +3779,10 @@ func unionArrayArrayInPlace(a, b *Container) *Container {
// for InPlace, we actually want to ensure that
// we update a, as long as it's not frozen.
a = a.Thaw()
a.setArray(b.array())
// ... but we also want to be sure we don't end up
// copying in a mapped object into our not-mapped
// object.
a.setArrayMaybeCopy(b.array(), b.Mapped())
return a.optimize()
}
return a