nptl: Fix cleanups for stack grows up [BZ# 28899]
authorJohn David Anglin <danglin@gcc.gnu.org>
Mon, 28 Feb 2022 15:47:38 +0000 (15:47 +0000)
committerJohn David Anglin <danglin@gcc.gnu.org>
Mon, 28 Feb 2022 15:47:38 +0000 (15:47 +0000)
_STACK_GROWS_DOWN is defined to 0 when the stack grows up.  The
code in unwind.c used `#ifdef _STACK_GROWS_DOWN' to selct the
stack grows down define for FRAME_LEFT.  As a result, the
_STACK_GROWS_DOWN define was always selected and cleanups were
incorrectly sequenced when the stack grows up.

nptl/unwind.c

index c3563e3..33b0d87 100644 (file)
@@ -25,7 +25,7 @@
 #include <jmpbuf-unwind.h>
 #include <shlib-compat.h>
 
-#ifdef _STACK_GROWS_DOWN
+#if _STACK_GROWS_DOWN
 # define FRAME_LEFT(frame, other, adj) \
   ((uintptr_t) frame - adj >= (uintptr_t) other - adj)
 #elif _STACK_GROWS_UP