bpo-36734: Fix compilation of faulthandler.c on HP-UX (GH-12970) · python/cpython@b84cb70 (original) (raw)

2 files changed

lines changed

Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
1 +Fix compilation of ``faulthandler.c`` on HP-UX. Initialize ``stack_t
2 +current_stack`` to zero using ``memset()``.
Original file line number Diff line number Diff line change
@@ -1370,7 +1370,8 @@ void _PyFaulthandler_Fini(void)
1370 1370 #ifdef HAVE_SIGALTSTACK
1371 1371 if (stack.ss_sp != NULL) {
1372 1372 /* Fetch the current alt stack */
1373 -stack_t current_stack = {};
1373 +stack_t current_stack;
1374 +memset(&current_stack, 0, sizeof(current_stack));
1374 1375 if (sigaltstack(NULL, &current_stack) == 0) {
1375 1376 if (current_stack.ss_sp == stack.ss_sp) {
1376 1377 /* The current alt stack is the one that we installed.