From cfb068a922ded8e1f8629111026929feb33c6282 Mon Sep 17 00:00:00 2001 From: Vern Paxson Date: Mon, 5 Aug 2024 09:19:50 +0100 Subject: [PATCH] fix to correctly track whether a capture needs deep-copying --- src/Type.cc | 3 +++ 1 file changed, 3 insertions(+) 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