You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[ffigen] Crash when a struct member or typedef is a pointer to a function with an unsupported parameter type #3691
ffigen throws an unhandled exception during code generation when a struct
member or a typedef is a pointer to a function whose parameters include a
type ffigen cannot represent (a C++ reference here). The unsupported type is
detected for functions and for direct function-pointer fields, but not when
the function pointer is reached through a typedef.
Unhandled exception:
Unsupported operation: No mapping for type: (Unimplemented: Function parameter has an unsupported type.)
#0 Type.getCType (package:ffigen/src/code_generator/type.dart:52:7)
#1 PointerType.getCType (package:ffigen/src/code_generator/pointer.dart:32:58)
#2 Type.getFfiDartType (package:ffigen/src/code_generator/type.dart:56:45)
#3 Typealias.getFfiDartType (package:ffigen/src/code_generator/typealias.dart:167:17)
#4 Compound.toBindingString (package:ffigen/src/code_generator/compound.dart:200:38)
#5 Writer.generate (package:ffigen/src/code_generator/writer.dart:162:17)
Including the typedef instead of the struct, with Visitor(typealias: (node) => node.isIncluded = TypealiasInclude.always),
crashes the same way from Typealias.toBindingString.
Activity