From 4f0d151c7ac03a1535ae8dfa698a2bca23b94162 Mon Sep 17 00:00:00 2001 From: Joshua Suskalo Date: Thu, 14 Oct 2021 19:22:30 -0500 Subject: [PATCH] Fix crash when returning void in an upcall --- CHANGELOG.md | 2 ++ src/clj/coffi/mem.clj | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3d30841..225a461 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 +- Void return types on upcalls would crash on serialization ## [0.1.251] - 2021-10-14 ### Fixed diff --git a/src/clj/coffi/mem.clj b/src/clj/coffi/mem.clj index 8e87d4a..b003216 100644 --- a/src/clj/coffi/mem.clj +++ b/src/clj/coffi/mem.clj @@ -417,6 +417,10 @@ obj) (MemoryAddress/NULL))) +(defmethod serialize* ::void + [_obj _type _scope] + nil) + (defmulti serialize-into "Writes a serialized version of the `obj` to the given `segment`.