From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,a676349b69fa778f X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-02-12 06:44:15 PST Path: supernews.google.com!sn-xit-02!supernews.com!news.gv.tsc.tdk.com!news.iac.net!news-out.cwix.com!newsfeed.cwix.com!news.maxwell.syr.edu!btnet-peer!btnet!news2.vas-net.net!server2.netnews.ja.net!newshost.central.susx.ac.uk!news.bton.ac.uk!not-for-mail From: John English Newsgroups: comp.lang.ada Subject: Re: Help: my list adt is broken Date: Mon, 12 Feb 2001 14:23:50 +0000 Organization: University of Brighton Message-ID: <3A87F1F6.664D51BC@bton.ac.uk> References: <79Dh6.10732$zz4.264993@news2-win.server.ntlworld.com> NNTP-Posting-Host: straumli.it.bton.ac.uk Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: saturn.bton.ac.uk 981987809 16534 193.62.183.204 (12 Feb 2001 14:23:29 GMT) X-Complaints-To: news@bton.ac.uk NNTP-Posting-Date: 12 Feb 2001 14:23:29 GMT X-Mailer: Mozilla 4.5 [en] (Win95; I) X-Accept-Language: en Xref: supernews.google.com comp.lang.ada:5163 Date: 2001-02-12T14:23:29+00:00 List-Id: "chris.danx" wrote: > > Hi, > Thanks again for everyones help. In the end it only took 6 lines of > code to fix (two if statements ...). One thing interests me though. Why > wasn't an exception generated when i walked the list? I deleted the node p > in the code, so it shouldn't be there, should it? Your list still pointed to the deleted item; the block of memory is still there (you haven't deleted a chunk of physical RAM ;-) but you were lucky (unlucky?) that the block hadn't been reallocated and used for something else. It's your responsibility to avoid referring to memory blocks that you delete, and that's why the deletion is done by a procedure called UNCHECKED_Deallocation... there are no runtime checks to ensure that your pointers are all still valid afterwards. ----------------------------------------------------------------- John English | mailto:je@brighton.ac.uk Senior Lecturer | http://www.it.bton.ac.uk/staff/je Dept. of Computing | ** NON-PROFIT CD FOR CS STUDENTS ** University of Brighton | -- see http://burks.bton.ac.uk -----------------------------------------------------------------