cffi gets stuck in a loop when returning a struct containing a slot with a typedef of a bitfield

Bug #1474631 reported by 3b
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
CFFI
New
Undecided
Unassigned

Bug Description

(cffi:defbitfield foo-)
(cffi:defctype foo foo-)
(cffi:defcstruct sfoo
  (foo foo))

(cffi:defcfun foo (:struct sfoo))
(foo)
;; doesn't return, expected error about undefined function

apparently caused by LIBFFI-TYPE-POINTER calling FOLLOW-TYPEDEF on an ENHANCED-TYPEDEF expecting to get back the referenced type, but instead getting back the original type because FOLLOR-TYPEDEF checks for (eq (type-of type) 'foreign-typedef) rather than TYPEP

v0.15, sbcl linux/windows

Revision history for this message
3b (00003b) wrote :

actually, doesn't work on bitfields without the typedef as well, since they are also subclasses of FOREIGN-TYPEDEF.

Revision history for this message
Luís Oliveira (luismbo) wrote :

There was initial attempt at fixing this that broke foreign-aref and friends, so it was reverted by <https://github.com/cffi/cffi/pull/79>.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.