Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!uunet!zaphod.mps.ohio-state.edu!sdd.hp.com!news.cs.indiana.edu!maytag!watstat.waterloo.edu!dmurdoch From: dmurdoch@watstat.waterloo.edu (Duncan Murdoch) Newsgroups: comp.lang.pascal Subject: Re: DISPOSE'ing Message-ID: <1991Jun29.163728.16026@maytag.waterloo.edu> Date: 29 Jun 91 16:37:28 GMT References: <1144.286c2900@vger.nsu.edu> Sender: news@maytag.waterloo.edu (News Owner) Organization: University of Waterloo Lines: 28 In article <1144.286c2900@vger.nsu.edu> g_harrison@vger.nsu.edu (George C. Harrison, Norfolk State University) writes: >A student has been crying the blues because he code works on >Turbo Pascal and not on VAX Pascal. It is totally ISO standard. >His program contains code similar to > >program TEST; >type PTR = ^NODE; > NODE = record > DATA : INTEGER; > NEXT : PTR > end; >var > P, TEMP : PTR; >begin > new(P); > TEMP := P; > DISPOSE(P); > DISPOSE(TEMP) >end. > >Apparently TP (of which I am NOT an expert) allows for a program to >dispose of the nodes pointed to by P and TEMP even though the nodes >are at exactly the same location. Is that really allowed by the standard? TP version 6 catches it as a run-time error 204, invalid pointer operation. Duncan Murdoch