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
Commit 8f64929
Browse filesBrowse the repository at this point in the historyBrowse files
Test that a coerced TYPE_CONST_STRING argument stays in place
A TYPE_CONST_STRING argument that comes from a to_str object is coerced
inside Fiddle, so the caller's argv holds that object and not the String
that the char * points into. Only converted_args holds the coerced
String, and the conservative scan of the ALLOCV buffer is what keeps it
in place while ffi_call runs without the GVL.
Nothing tested that. Before #205, converted_args was a Ruby Array, whose
elements the GC may move, and the C function read the slot the String
left. #205 replaced the Array with this buffer and corrected the fault as
a side effect. A later change could move these values back to storage the
GC may relocate, and no test would notice.
Add the missing test, and record the requirement next to the buffer.
0 commit comments