Fix bug where one too many indirections are used with pointer types

This commit is contained in:
Joshua Suskalo 2024-10-03 15:36:20 -04:00
parent 4f1d8f2990
commit 8e088c75b2
No known key found for this signature in database
GPG key ID: 9B6BA586EFF1B9F0
2 changed files with 4 additions and 2 deletions

View file

@ -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/). 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] ## [Unreleased]
### Fixed
- Bug where one too many indirections is used when serializing/deserializing pointer types
## [1.0.472] - 2024-10-03 ## [1.0.472] - 2024-10-03
### Added ### Added

View file

@ -876,7 +876,7 @@
(if (sequential? type) (if (sequential? type)
(let [segment (alloc-instance (second type) arena)] (let [segment (alloc-instance (second type) arena)]
(serialize-into obj (second type) segment arena) (serialize-into obj (second type) segment arena)
(address-of segment)) segment)
obj) obj)
null)) null))
@ -1082,7 +1082,7 @@
(if (sequential? type) (if (sequential? type)
(let [target-type (second type)] (let [target-type (second type)]
(deserialize-from (deserialize-from
(.reinterpret ^MemorySegment (read-address addr) (.reinterpret ^MemorySegment addr
^long (size-of target-type)) ^long (size-of target-type))
target-type)) target-type))
addr))) addr)))