bpo-36734: Fix compilation of faulthandler.c on HP-UX (GH-12970)

Initialize "stack_t current_stack" to zero using memset().
This commit is contained in:
Victor Stinner 2019-04-30 12:19:34 +02:00 committed by GitHub
parent 3bbcc92577
commit b84cb70880
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 1 deletions

View File

@ -0,0 +1,2 @@
Fix compilation of ``faulthandler.c`` on HP-UX. Initialize ``stack_t
current_stack`` to zero using ``memset()``.

View 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.