Fix a bug where void returns on upcalls crash the JVM
This commit is contained in:
parent
66eefc7a13
commit
22343b8512
2 changed files with 3 additions and 1 deletions
|
|
@ -3,6 +3,7 @@ All notable changes to this project will be documented in this file. This change
|
||||||
|
|
||||||
## [Unreleased]
|
## [Unreleased]
|
||||||
### Fixed
|
### Fixed
|
||||||
|
- Void return types on upcalls crash the JVM
|
||||||
- Invalid implementation of serialize-into for primitive types
|
- Invalid implementation of serialize-into for primitive types
|
||||||
|
|
||||||
## [0.1.192] - 2021-09-30
|
## [0.1.192] - 2021-09-30
|
||||||
|
|
|
||||||
|
|
@ -315,7 +315,8 @@
|
||||||
(defmethod serialize* :default
|
(defmethod serialize* :default
|
||||||
[obj type _scope]
|
[obj type _scope]
|
||||||
(if-let [prim (primitive-type type)]
|
(if-let [prim (primitive-type type)]
|
||||||
((primitive-cast prim) obj)
|
(when-not (= ::void prim)
|
||||||
|
((primitive-cast prim) obj))
|
||||||
(throw (ex-info "Attempted to serialize a non-primitive type with primitive methods"
|
(throw (ex-info "Attempted to serialize a non-primitive type with primitive methods"
|
||||||
{:type type
|
{:type type
|
||||||
:object obj}))))
|
:object obj}))))
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue