diff --git a/CHANGELOG.md b/CHANGELOG.md index 07295f6..717ee20 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ All notable changes to this project will be documented in this file. This change ## [Unreleased] ### Fixed +- Primitive-serializing types fail to compile as arguments to downcall handles - Primitive-serializing types fail to load as arguments to upcall functions - Void return types on upcalls crash the JVM - Invalid implementation of serialize-into for primitive types diff --git a/src/clj/coffi/ffi.clj b/src/clj/coffi/ffi.clj index 66f5772..75c6b6a 100644 --- a/src/clj/coffi/ffi.clj +++ b/src/clj/coffi/ffi.clj @@ -108,9 +108,10 @@ (defn- insn-layout "Gets the type keyword or class for referring to the type in bytecode." [type] - (if (some-> (mem/primitive-type type) (not= ::mem/pointer)) - (keyword (name type)) - (mem/java-layout type))) + (when-some [prim (mem/primitive-type type)] + (if (not= prim ::mem/pointer) + (keyword (name prim)) + (mem/java-layout type)))) (def ^:private unbox-fn-for-type "Map from type name to the name of its unboxing function."