diff --git a/src/Type.cc b/src/Type.cc index 5341476a3f..c00410c0ad 100644 --- a/src/Type.cc +++ b/src/Type.cc @@ -603,6 +603,9 @@ SetType::~SetType() = default; #pragma GCC diagnostic ignored "-Wdeprecated-declarations" 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; + if ( ! is_managed ) + // For non-managed types, deep copying isn't applicable. + deep_copy = false; } #pragma GCC diagnostic pop