public inbox for cygwin-cvs@sourceware.org
help / color / mirror / Atom feed
* [newlib-cygwin] Cygwin: sigproc: Fix a thinko in array size
@ 2020-08-28 17:38 Corinna Vinschen
  0 siblings, 0 replies; only message in thread
From: Corinna Vinschen @ 2020-08-28 17:38 UTC (permalink / raw)
  To: cygwin-cvs

https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=bf251d5a0b644f7b5165a404822d88f532593160

commit bf251d5a0b644f7b5165a404822d88f532593160
Author: Corinna Vinschen <corinna@vinschen.de>
Date:   Fri Aug 28 19:38:05 2020 +0200

    Cygwin: sigproc: Fix a thinko in array size
    
    We need one more entry than max children in the arrays.
    There's no reason to do this for the static array, though.
    One more entry in the overflow array is sufficient.
    
    Signed-off-by: Corinna Vinschen <corinna@vinschen.de>

Diff:
---
 winsup/cygwin/sigproc.cc | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/winsup/cygwin/sigproc.cc b/winsup/cygwin/sigproc.cc
index aa946fb4c..2a9734f00 100644
--- a/winsup/cygwin/sigproc.cc
+++ b/winsup/cygwin/sigproc.cc
@@ -47,14 +47,14 @@ char NO_COPY myself_nowait_dummy[1] = {'0'};
 /* All my children info.  Avoid expensive constructor ops at DLL startup */
 class child_procs {
 #ifdef __i386__
-    static const int _NPROCS = 255;
+    static const int _NPROCS = 256;
     static const int _NPROCS_2 = 1023;
 #else
-    static const int _NPROCS = 1023;
+    static const int _NPROCS = 1024;
     static const int _NPROCS_2 = 4095;
 #endif
     int _count;
-    uint8_t _procs[(_NPROCS + 1) * sizeof (pinfo)] __attribute__ ((__aligned__));
+    uint8_t _procs[_NPROCS * sizeof (pinfo)] __attribute__ ((__aligned__));
     pinfo *_procs_2;
   public:
     int count () const { return _count; }


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-08-28 17:38 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-28 17:38 [newlib-cygwin] Cygwin: sigproc: Fix a thinko in array size Corinna Vinschen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).