Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:Ledest:erlang:24
erlang
7822-Fix-Windows-warnings-second-attempt.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 7822-Fix-Windows-warnings-second-attempt.patch of Package erlang
From 1cf00de37d8415be2f0eb7365b88ba4f9ee41008 Mon Sep 17 00:00:00 2001 From: Raimo Niskanen <raimo@erlang.org> Date: Wed, 27 Mar 2024 16:45:13 +0100 Subject: [PATCH] Fix Windows warnings, second attempt The intermediate variable that was removed in the first attenpt was needed when the port closed for a DEBUGF printout to not access deallocated memory. --- erts/emulator/drivers/common/inet_drv.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/erts/emulator/drivers/common/inet_drv.c b/erts/emulator/drivers/common/inet_drv.c index 66a5f77d5d..3c712f6109 100644 --- a/erts/emulator/drivers/common/inet_drv.c +++ b/erts/emulator/drivers/common/inet_drv.c @@ -12856,8 +12856,11 @@ static void tcp_inet_event(ErlDrvData e, ErlDrvEvent event) static int tcp_inet_input(tcp_descriptor* desc, HANDLE event) { int ret = 0; +#ifdef DEBUG + long port = (long) desc->inet.port; /* Used after driver_exit() */ +#endif ASSERT(!INET_IGNORED(INETP(desc))); - DEBUGF(("tcp_inet_input(%p) {s=%d\r\n", desc->inet.port, desc->inet.s)); + DEBUGF(("tcp_inet_input(%lx) {s=%d\r\n", port, desc->inet.s)); if (desc->inet.state == INET_STATE_ACCEPTING) { SOCKET s; unsigned int len; @@ -12994,11 +12997,11 @@ static int tcp_inet_input(tcp_descriptor* desc, HANDLE event) else { /* maybe a close op from connection attempt?? */ sock_select(INETP(desc),FD_ACCEPT,0); - DEBUGF(("tcp_inet_input(%p): s=%d bad state: %04x\r\n", - desc->inet.port, desc->inet.s, desc->inet.state)); + DEBUGF(("tcp_inet_input(%lx): s=%d bad state: %04x\r\n", + port, desc->inet.s, desc->inet.state)); } done: - DEBUGF(("tcp_inet_input(%p) }\r\n", desc->inet.port)); + DEBUGF(("tcp_inet_input(%lx) }\r\n", port)); return ret; } -- 2.35.3
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor