From 3ce919e5a1a146cf228e10b19f4a7aa5aad695af Mon Sep 17 00:00:00 2001 From: Joshua Suskalo Date: Thu, 23 Sep 2021 13:29:00 -0500 Subject: [PATCH] Fix broken bytecode in upcalls --- src/clj/coffi/ffi.clj | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/clj/coffi/ffi.clj b/src/clj/coffi/ffi.clj index bc4c7b1..07cd733 100644 --- a/src/clj/coffi/ffi.clj +++ b/src/clj/coffi/ffi.clj @@ -879,14 +879,13 @@ :desc (conj (mapv java-layout arg-types) (java-layout ret-type)) :emit [[:aload 0] - [:dup] [:getfield :this "upcall_ifn" IFn] (map-indexed (fn [idx arg] [[(load-instructions arg) (inc idx)] (to-object-asm arg)]) arg-types) - [:invokevirtual IFn "invoke" (repeat (inc (count arg-types)) Object)] + [:invokeinterface IFn "invoke" (repeat (inc (count arg-types)) Object)] ;; TODO(Joshua): If this returns nil and this is primitive, ;; return a default value (to-prim-asm ret-type)