]> granicus.if.org Git - python/commitdiff
bpo-36734: Fix compilation of faulthandler.c on HP-UX (GH-12970)
authorVictor Stinner <vstinner@redhat.com>
Tue, 30 Apr 2019 10:19:34 +0000 (12:19 +0200)
committerGitHub <noreply@github.com>
Tue, 30 Apr 2019 10:19:34 +0000 (12:19 +0200)
Initialize "stack_t current_stack" to zero using memset().

Misc/NEWS.d/next/Library/2019-04-26-17-14-20.bpo-36734.p2MaiN.rst [new file with mode: 0644]
Modules/faulthandler.c

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 (file)
index 0000000..0934199
--- /dev/null
@@ -0,0 +1,2 @@
+Fix compilation of ``faulthandler.c`` on HP-UX. Initialize ``stack_t
+current_stack`` to zero using ``memset()``.
index 30fe18695fec828fefd93821e8bd2215f148d39f..d45b8660ee65f784938f42b97404aa099577b391 100644 (file)
@@ -1370,7 +1370,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(&current_stack, 0, sizeof(current_stack));
         if (sigaltstack(NULL, &current_stack) == 0) {
             if (current_stack.ss_sp == stack.ss_sp) {
                 /* The current alt stack is the one that we installed.