From: sandmann AT clio DOT rice DOT edu (Charles Sandmann) Message-Id: <10302122051.AA01639@clio.rice.edu> Subject: Re: Checking for stack overflow To: djgpp-workers AT delorie DOT com Date: Wed, 12 Feb 2003 14:51:50 -0600 (CST) In-Reply-To: from "Esa A E Peuha" at Feb 12, 2003 11:12:49 AM X-Mailer: ELM [version 2.5 PL2] Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Reply-To: djgpp-workers AT delorie DOT com Errors-To: nobody AT delorie DOT com X-Mailing-List: djgpp-workers AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk > I committed patch for __djgpp_stack_top; we should have it anyway > because __djgpp_stack_limit + _stklen won't be the real top of stack if > it's not aligned to 8-byte boundary. Fine. It would be nice if this was documented, but I don't see any docs for __djgpp_stack_limit either (sigh). > > I think the change to "jb" fixes the signed-ness issue - so I'm not > > sure this is really needed. > > I don't understand. Do you mean that a single unsigned comparsion > against __djgpp_stack_limit is enough? It's not; it's even worse than > the single signed comparsion (if esp ever wraps below zero, the unsigned > comparsion will never detect it, while the signed one will usually do). I think you're right - too much typing without thinking on my part > > I'd be interested to see this working, see how much of a run-time > > impact it has, and how much checking the second limit changes the > > run-time performance. > > I'll provide two version of patched gcc, one with one signed comparsion > and the other with two unsigned ones. I think a single version with the right behavior would be best :-)