fix to correctly track whether a capture needs deep-copying

This commit is contained in:
Vern Paxson 2024-08-05 09:19:50 +01:00 committed by Arne Welzel
parent e6fe20f140
commit cfb068a922

View file

@ -603,6 +603,9 @@ SetType::~SetType() = default;
#pragma GCC diagnostic ignored "-Wdeprecated-declarations" #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
FuncType::Capture::Capture(detail::IDPtr _id, bool _deep_copy) : id(std::move(_id)), deep_copy(_deep_copy) { FuncType::Capture::Capture(detail::IDPtr _id, bool _deep_copy) : id(std::move(_id)), deep_copy(_deep_copy) {
is_managed = id ? ZVal::IsManagedType(id->GetType()) : false; is_managed = id ? ZVal::IsManagedType(id->GetType()) : false;
if ( ! is_managed )
// For non-managed types, deep copying isn't applicable.
deep_copy = false;
} }
#pragma GCC diagnostic pop #pragma GCC diagnostic pop