summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSergejs Lukanihins <slukanihin@gmail.com>2018-05-25 17:27:21 +0100
committerCorinna Vinschen <corinna@vinschen.de>2018-05-29 18:37:33 +0200
commit06797545b3270f8cfafe1d8314970dc705f29d39 (patch)
tree45427c60f429b6a770978e788e370b5d82bae1be
parent53960db861a3fec90a3173469cf18a7cc2a13c4e (diff)
downloadcygnal-06797545b3270f8cfafe1d8314970dc705f29d39.tar.gz
cygnal-06797545b3270f8cfafe1d8314970dc705f29d39.tar.bz2
cygnal-06797545b3270f8cfafe1d8314970dc705f29d39.zip
Cygwin: Fixing the math behind rounding down ch.stacklimit to page size.
-rw-r--r--winsup/cygwin/fork.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/winsup/cygwin/fork.cc b/winsup/cygwin/fork.cc
index bcbef12d8..c6fef6755 100644
--- a/winsup/cygwin/fork.cc
+++ b/winsup/cygwin/fork.cc
@@ -316,7 +316,7 @@ frok::parent (volatile char * volatile stack_here)
on whether we're running on a pthread or not. If pthread, we fetch
the guardpage size from the pthread attribs, otherwise we use the
system default. */
- ch.stacklimit = (void *) ((uintptr_t) stack_here & ~wincap.page_size ());
+ ch.stacklimit = (void *) ((uintptr_t) stack_here & ~(wincap.page_size () - 1));
ch.guardsize = (&_my_tls != _main_tls && _my_tls.tid)
? _my_tls.tid->attr.guardsize
: wincap.def_guard_page_size ();