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
1007
1007
sockaddrStorageLen :: Int
1008
1008
sockaddrStorageLen = 128
1009
1009
1010
+ {-# NOINLINE withSocketAddress #-}
1010
1011
withSocketAddress :: SocketAddress sa => sa -> (Ptr sa -> Int -> IO a ) -> IO a
1011
1012
withSocketAddress addr f = do
1012
1013
let sz = sizeOfSocketAddress addr
@@ -1114,6 +1115,9 @@ sizeOfSockAddr SockAddrUnix{} = #const sizeof(struct sockaddr_un)
1114
1115
sizeOfSockAddr SockAddrInet {} = # const sizeof(struct sockaddr_in)
1115
1116
sizeOfSockAddr SockAddrInet6 {} = # const sizeof(struct sockaddr_in6)
1116
1117
1118
+ -- The combination of "-XString" and inlining results in a bug where
1119
+ -- "sz" is always 0.
1120
+ {-# NOINLINE withSockAddr #-}
1117
1121
-- | Use a 'SockAddr' with a function requiring a pointer to a
1118
1122
-- 'SockAddr' and the length of that 'SockAddr'.
1119
1123
withSockAddr :: SockAddr -> (Ptr SockAddr -> Int -> IO a ) -> IO a
You can’t perform that action at this time.
0 commit comments