Fix a bug where non-primitive argument types failed to link

This commit is contained in:
Joshua Suskalo 2021-10-06 19:37:15 -05:00
parent 0db99f9106
commit ab82b6a5a1
2 changed files with 7 additions and 4 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/).
## [Unreleased]
### Fixed
- Non-primitive argument types fail to link
## [0.1.205] - 2021-10-06
### Added

View file

@ -20,6 +20,7 @@
CLinker
FunctionDescriptor
MemoryLayout
MemorySegment
SegmentAllocator)))
;;; FFI Code loading and function access
@ -108,10 +109,10 @@
(defn- insn-layout
"Gets the type keyword or class for referring to the type in bytecode."
[type]
(when-some [prim (mem/primitive-type type)]
(if (not= prim ::mem/pointer)
(keyword (name prim))
(mem/java-layout type))))
(or (when-some [prim (mem/primitive-type type)]
(when (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."