diff --git a/CHANGELOG.md b/CHANGELOG.md index c9f1e85..32bc376 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ All notable changes to this project will be documented in this file. This change log follows the conventions of [keepachangelog.com](http://keepachangelog.com/). ## [Unreleased] +### Fixed +- Bug where one too many indirections is used when serializing/deserializing pointer types ## [1.0.472] - 2024-10-03 ### Added diff --git a/src/clj/coffi/mem.clj b/src/clj/coffi/mem.clj index 7dde14a..955d821 100644 --- a/src/clj/coffi/mem.clj +++ b/src/clj/coffi/mem.clj @@ -876,7 +876,7 @@ (if (sequential? type) (let [segment (alloc-instance (second type) arena)] (serialize-into obj (second type) segment arena) - (address-of segment)) + segment) obj) null)) @@ -1082,7 +1082,7 @@ (if (sequential? type) (let [target-type (second type)] (deserialize-from - (.reinterpret ^MemorySegment (read-address addr) + (.reinterpret ^MemorySegment addr ^long (size-of target-type)) target-type)) addr)))