Skip to content

Commit

Permalink
[int] src/lispifiers.lisp: don't lispify the null pointer in lispify
Browse files Browse the repository at this point in the history
  • Loading branch information
Madhu authored and digikar99 committed Jul 14, 2024
1 parent 16e0c44 commit 75c4fe5
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/lispifiers.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,10 @@
(optimize speed)
(inline gethash pyobject-typename/simple djb2-foreign-string-hash))
(assert (eq :lisp *pyobject-translation-mode*))
;; The performance impact of this check is less than 2%
;; -- so it's worth it for a slightly more robust system.
(if (null-pointer-p pyobject)
(return-from lispify nil))
(let* ((pytype-name-foreign (pyobject-typename/simple pyobject))
(pytype-name-hash (djb2-foreign-string-hash pytype-name-foreign))
;; FIXME: What about names in modules?
Expand Down

0 comments on commit 75c4fe5

Please sign in to comment.