Fix bug with primitive-serializing arguments to downcalls not compiling

This commit is contained in:
Joshua Suskalo 2021-10-01 10:39:32 -05:00
parent b98fdc05ea
commit 673a653200
2 changed files with 5 additions and 3 deletions

View file

@ -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

View file

@ -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."