Bug
A null char* returned from FFI doesn't reliably compare === "" on the TS side. Worked around in lib/net.ts (PR #585) by exposing an explicit isOpen() probe instead of relying on empty-string-as-sentinel.
Impact
Bridges that return "error or no result" via a null C string can't use empty-string as a failure sentinel from the TS side. Forces each bridge to add explicit _is_* / _last_error probe functions.
Workaround pattern (current)
// net-bridge.c
char *cs_net_last_error(void *sock) { ... returns GC'd string or NULL ... }
int cs_socket_is_open(void *sock) { ... returns 0/1 explicitly ... }
// lib/net.ts — instead of
if (err === "") { /* ok */ }
// use
if (socket.isOpen()) { /* ok */ }
Likely fix location
FFI string-return marshaling — null char* should round-trip to TS as empty string or a distinguished null sentinel consistently.
Bug
A
nullchar*returned from FFI doesn't reliably compare=== ""on the TS side. Worked around inlib/net.ts(PR #585) by exposing an explicitisOpen()probe instead of relying on empty-string-as-sentinel.Impact
Bridges that return "error or no result" via a null C string can't use empty-string as a failure sentinel from the TS side. Forces each bridge to add explicit
_is_*/_last_errorprobe functions.Workaround pattern (current)
Likely fix location
FFI string-return marshaling — null
char*should round-trip to TS as empty string or a distinguished null sentinel consistently.