From ... Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!newsfeed1.bredband.com!bredband!uio.no!nntp.uio.no!ifi.uio.no!not-for-mail From: Erik Naggum Newsgroups: comp.lang.lisp Subject: Re: Bounding Indices in Sequence Functions Date: 22 Oct 2002 17:16:01 +0000 Organization: Naggum Software, Oslo, Norway Lines: 18 Message-ID: <3244295761850806@naggum.no> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: maud.ifi.uio.no 1035306962 25585 129.240.65.5 (22 Oct 2002 17:16:02 GMT) X-Complaints-To: abuse@ifi.uio.no NNTP-Posting-Date: 22 Oct 2002 17:16:02 GMT Mail-Copies-To: never User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 Xref: archiver1.google.com comp.lang.lisp:44336 * Barry Margolin | There's nothing guaranteeing this. It's not required to check that | end<=length, and if it doesn't check you can get a buffer overflow (like | the kind that have been the cause of so many security problems). That does not follow strictly from the premises. The test for an actual index < length may well be performed without testing that end <= length. Although some CPU cycles may conceivably be saved by testing once, the test may also be performed in parallel with the actual memory access instruction in such a way that a test at the head of the loop would only waste resources and be obnoxious if the purpose of the function were to be satisfied before the condition became relevant. -- Erik Naggum, Oslo, Norway Act from reason, and failure makes you rethink and study harder. Act from faith, and failure makes you blame someone and push harder.