From 1c5fbff3dd5975db2f78092b482a98573b22d9dd Mon Sep 17 00:00:00 2001 From: Joshua Suskalo Date: Thu, 16 Sep 2021 16:01:33 -0500 Subject: [PATCH] Fix bug relying on old behavior of c-layout for serialize-into --- src/coffi/ffi.clj | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/coffi/ffi.clj b/src/coffi/ffi.clj index ad67988..772d342 100644 --- a/src/coffi/ffi.clj +++ b/src/coffi/ffi.clj @@ -265,12 +265,11 @@ (defmethod serialize-into :default [obj type segment scope] - (let [new-type (c-layout type)] - (if (qualified-keyword? new-type) - (serialize-into (serialize* obj type scope) new-type segment scope) - (throw (ex-info "Attempted to serialize an object to a type that has not been overriden." - {:type type - :object obj}))))) + (if-some [prim-layout (primitive-type type)] + (serialize-into (serialize* obj type scope) prim-layout segment scope) + (throw (ex-info "Attempted to serialize an object to a type that has not been overriden." + {:type type + :object obj})))) (defmethod serialize-into ::byte [obj _type segment _scope]