File tree Expand file tree Collapse file tree 1 file changed +4
-0
lines changed Expand file tree Collapse file tree 1 file changed +4
-0
lines changed Original file line number Diff line number Diff line change @@ -1007,6 +1007,7 @@ class SocketAddress sa where
10071007sockaddrStorageLen :: Int
10081008sockaddrStorageLen = 128
10091009
1010+ {-# NOINLINE withSocketAddress #-}
10101011withSocketAddress :: SocketAddress sa => sa -> (Ptr sa -> Int -> IO a ) -> IO a
10111012withSocketAddress addr f = do
10121013 let sz = sizeOfSocketAddress addr
@@ -1114,6 +1115,9 @@ sizeOfSockAddr SockAddrUnix{} = #const sizeof(struct sockaddr_un)
11141115sizeOfSockAddr SockAddrInet {} = # const sizeof(struct sockaddr_in)
11151116sizeOfSockAddr SockAddrInet6 {} = # const sizeof(struct sockaddr_in6)
11161117
1118+ -- The combination of "-XString" and inlining results in a bug where
1119+ -- "sz" is always 0.
1120+ {-# NOINLINE withSockAddr #-}
11171121-- | Use a 'SockAddr' with a function requiring a pointer to a
11181122-- 'SockAddr' and the length of that 'SockAddr'.
11191123withSockAddr :: SockAddr -> (Ptr SockAddr -> Int -> IO a ) -> IO a
You can’t perform that action at this time.
0 commit comments