Skip to content

Commit

Permalink
Merge pull request #20 from dscho/ch.stacklimit-rounding
Browse files Browse the repository at this point in the history
Cygwin: Fixing the math behind rounding down ch.stacklimit to page size.
  • Loading branch information
dscho committed Jul 16, 2018
2 parents 5b0abb2 + 36e86e5 commit f02cd24
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion winsup/cygwin/fork.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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 ();
Expand Down

0 comments on commit f02cd24

Please sign in to comment.