From 5f5b187bfa17254f5ae55593820fc938c45c2b32 Mon Sep 17 00:00:00 2001 From: "Miss Islington (bot)" <31488909+miss-islington@users.noreply.github.com> Date: Tue, 30 Apr 2019 14:30:44 -0700 Subject: [PATCH] bpo-36734: Fix compilation of faulthandler.c on HP-UX (GH-12970) Initialize "stack_t current_stack" to zero using memset(). (cherry picked from commit b84cb70880a0acfcbbaca7bcda405af08f94d269) Co-authored-by: Victor Stinner --- .../next/Library/2019-04-26-17-14-20.bpo-36734.p2MaiN.rst | 2 ++ Modules/faulthandler.c | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) create mode 100644 Misc/NEWS.d/next/Library/2019-04-26-17-14-20.bpo-36734.p2MaiN.rst diff --git a/Misc/NEWS.d/next/Library/2019-04-26-17-14-20.bpo-36734.p2MaiN.rst b/Misc/NEWS.d/next/Library/2019-04-26-17-14-20.bpo-36734.p2MaiN.rst new file mode 100644 index 000000000000..09341990a63d --- /dev/null +++ b/Misc/NEWS.d/next/Library/2019-04-26-17-14-20.bpo-36734.p2MaiN.rst @@ -0,0 +1,2 @@ +Fix compilation of ``faulthandler.c`` on HP-UX. Initialize ``stack_t +current_stack`` to zero using ``memset()``. diff --git a/Modules/faulthandler.c b/Modules/faulthandler.c index cf24c9b2b9ad..ec5192832ce0 100644 --- a/Modules/faulthandler.c +++ b/Modules/faulthandler.c @@ -1369,7 +1369,8 @@ void _PyFaulthandler_Fini(void) #ifdef HAVE_SIGALTSTACK if (stack.ss_sp != NULL) { /* Fetch the current alt stack */ - stack_t current_stack = {}; + stack_t current_stack; + memset(¤t_stack, 0, sizeof(current_stack)); if (sigaltstack(NULL, ¤t_stack) == 0) { if (current_stack.ss_sp == stack.ss_sp) { /* The current alt stack is the one that we installed. -- 2.47.3