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
Fix life time of FFI CData and FFI CType with FFI\CDef
For GH-8556 the return type is stored in the CDef and doesn't outlive
the CData. In that case it happened because temporaries were used, but
it's also possible to get this with compiled variables when the variable
holding the CDef leaves the scope.
For GH-12910 the exception trace is built after the compiled variables
are destroyed, so that means the FFI CDef instance got destroyed but the
CData argument still remained. When the trace building code tries to get
the class string for the exception, the CData instance tries to access
the already-freed CDef.
Fix all of this by storing a reference to the CDef object inside of
CData and CType.
ClosesGH-8556.
ClosesGH-12910.
0 commit comments