From b21a5db27e6d7612092a451d9f82c4fb90198c6a Mon Sep 17 00:00:00 2001 From: blak3mill3r Date: Mon, 25 Oct 2021 03:05:14 +0000 Subject: [PATCH 1/2] fix: default to an `aload` instruction for upcall this allows non-primitive types prior to this commit the library would generate invalid bytecode with a `nil` instruction --- src/clj/coffi/ffi.clj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/clj/coffi/ffi.clj b/src/clj/coffi/ffi.clj index 87fe7c2..3862ce4 100644 --- a/src/clj/coffi/ffi.clj +++ b/src/clj/coffi/ffi.clj @@ -490,7 +490,7 @@ (if (seq types) (let [prim (mem/primitive-type (first types))] (recur (rest types) - (conj acc [[(load-instructions prim) idx] + (conj acc [[(load-instructions prim :aload) idx] (to-object-asm (first types))]) (cond-> (inc idx) (double-sized? prim) From 9254f7d6f7d5ec4f46405d56465971796c56613f Mon Sep 17 00:00:00 2001 From: blak3mill3r Date: Mon, 25 Oct 2021 03:10:02 +0000 Subject: [PATCH 2/2] update CHANGELOG --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2f8b328..dc208a6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ All notable changes to this project will be documented in this file. This change ### Fixed - Long and double arguments to upcalls failed to compile in some cases - Void return types on upcalls would crash on serialization +- Non-primitive types on upcalls was unsupported and would generate invalid bytecode with `nil` instructions ## [0.1.251] - 2021-10-14 ### Fixed