cppu/source/uno/assign.hxx | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-)
New commits: commit 58edf898989c8cba7e05bdac90db812a52ea03f2 Author: Mike Kaganski <mike.kagan...@collabora.com> AuthorDate: Tue Oct 26 10:53:02 2021 +0300 Commit: Mike Kaganski <mike.kagan...@collabora.com> CommitDate: Tue Oct 26 23:09:34 2021 +0200 d46f659c7524625474f0bb907805e285ee27d5ec follow-up: simplify checks Change-Id: Ib95e7c562741f76a742cd31aa033956a0f0a3c45 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124169 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kagan...@collabora.com> diff --git a/cppu/source/uno/assign.hxx b/cppu/source/uno/assign.hxx index c6a2cf58b457..3e2893fde824 100644 --- a/cppu/source/uno/assign.hxx +++ b/cppu/source/uno/assign.hxx @@ -384,20 +384,17 @@ inline bool _assignData( } return false; case typelib_TypeClass_SEQUENCE: - if (typelib_TypeClass_SEQUENCE != pSourceType->eTypeClass) + if (!_type_equals( pDestType, pSourceType )) return false; - // self assignment: - if (*static_cast<uno_Sequence **>(pSource) == *static_cast<uno_Sequence **>(pDest)) - return _type_equals(pDestType, pSourceType); // E.g. static empty sequence may be shared - if (_type_equals( pDestType, pSourceType )) + // check self assignment (only after _type_equals, to account for shared static empty): + if (*static_cast<uno_Sequence **>(pSource) != *static_cast<uno_Sequence **>(pDest)) { osl_atomic_increment( &(*static_cast<uno_Sequence **>(pSource))->nRefCount ); idestructSequence( *static_cast<uno_Sequence **>(pDest), pDestType, pDestTypeDescr, release ); *static_cast<uno_Sequence **>(pDest) = *static_cast<uno_Sequence **>(pSource); - return true; } - return false; + return true; case typelib_TypeClass_INTERFACE: if (typelib_TypeClass_INTERFACE != pSourceType->eTypeClass) return false;