From 56a9348111f736fc9da4f503fb52b592f7dc6107 Mon Sep 17 00:00:00 2001 From: Gang Wu Date: Sat, 10 Oct 2026 14:08:47 +0800 Subject: [PATCH] fix: prevent copying and moving StructLikeAccessor --- src/iceberg/row/struct_like.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/iceberg/row/struct_like.h b/src/iceberg/row/struct_like.h index 77f84e233f..df7315d9bd 100644 --- a/src/iceberg/row/struct_like.h +++ b/src/iceberg/row/struct_like.h @@ -109,6 +109,12 @@ class ICEBERG_EXPORT StructLikeAccessor { std::span position_path, std::vector is_optional); + // Deep-path accessors capture this, so the object must keep a stable address. + StructLikeAccessor(const StructLikeAccessor&) = delete; + StructLikeAccessor& operator=(const StructLikeAccessor&) = delete; + StructLikeAccessor(StructLikeAccessor&&) = delete; + StructLikeAccessor& operator=(StructLikeAccessor&&) = delete; + /// \brief Get the scalar value at the given position. /// A null optional parent returns monostate; a null required field is an error. Result Get(const StructLike& struct_like) const {