struct containing a ptr to a function with the struct as argument
This test fails (to be added to cffi1/test_recompiler) with a C-level stack overflow:
#!python
def test_struct_with_func_with_struct_arg():
ffi = FFI()
ffi.cdef("""struct BinaryTree {
int (* CompareKey)(struct BinaryTree tree);
};""")
lib = verify(ffi, "test_struct_with_func_with_struct_arg", """
struct BinaryTree {
int (* CompareKey)(struct BinaryTree tree);
};
""")
ffi.new("struct BinaryTree *")
This is because forcing the function-pointer type also forces the function type itself, which requires forcing the struct, leading to infinite recursion.