From b98fdc05ea6562b5b34cbb06b39e0c511b108d7e Mon Sep 17 00:00:00 2001 From: Joshua Suskalo Date: Fri, 1 Oct 2021 10:38:42 -0500 Subject: [PATCH] Fix primitive arguments to upcalls not compiling --- CHANGELOG.md | 1 + src/clj/coffi/ffi.clj | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e663a6b..07295f6 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 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 6fa1e32..66f5772 100644 --- a/src/clj/coffi/ffi.clj +++ b/src/clj/coffi/ffi.clj @@ -320,7 +320,7 @@ [:getfield :this "upcall_ifn" IFn] (map-indexed (fn [idx arg] - [[(load-instructions arg :aload) (inc idx)] + [[(load-instructions (mem/primitive-type arg) :aload) (inc idx)] (to-object-asm arg)]) arg-types) [:invokeinterface IFn "invoke" (repeat (inc (count arg-types)) Object)]