1. Python CFFI
  2. Untitled project
  3. cffi
Issue #42 resolved

ffi.addressof of an anonymous function crashes

Antonio Cuni
created an issue

using cffi 0.4:

import cffi

ffi = cffi.FFI()
ffi.cdef("""
    typedef struct {
        int x;
    } foo;

    foo get_foo(void);
""")

c = ffi.verify("""
    typedef struct {
        int x;
    } foo;

    foo get_foo(void)
    {
        foo res;
        res.x = 42;
        return res;
    };
    """)

foo = c.get_foo()
ffi.addressof(foo)

this crashes with the following error: ** CDefError: cannot parse "void __dummy(struct $foo );"

if I give an explicit name to the anonymous function, it works well.

Comments (3)

  1. Log in to comment