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=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!news.eternal-september.org!news.eternal-september.org!feeder.eternal-september.org!usenet.blueworldhosting.com!feeder01.blueworldhosting.com!peer02.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!post02.iad.highwinds-media.com!news.flashnewsgroups.com-b7.4zTQh5tI3A!not-for-mail From: Stephen Leake Newsgroups: comp.lang.ada Subject: Re: Deallocating an object twice References: <85bnsarfad.fsf@stephe-leake.org> Date: Mon, 28 Jul 2014 10:15:27 -0500 Message-ID: <8538dlqzu8.fsf@stephe-leake.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (windows-nt) Cancel-Lock: sha1:65onV9YjAtFRDYQa7Ethpw+cRtc= MIME-Version: 1.0 Content-Type: text/plain X-Complaints-To: abuse@flashnewsgroups.com Organization: FlashNewsgroups.com X-Trace: 8e8e453d66910e3fb833028243 X-Received-Bytes: 1642 X-Received-Body-CRC: 1733877406 Xref: news.eternal-september.org comp.lang.ada:21309 Date: 2014-07-28T10:15:27-05:00 List-Id: Victor Porton writes: > Stephen Leake wrote: > >> Victor Porton writes: >> >>> If I understand correctly, it is an undefined behavior (or is it called >>> unbounded error?) if a pool access is deallocated twice with >>> Unchecked_Deallocation. >> >> You misunderstand. >> >> ARM 2012 13.11.3 >> >> Procedure Free has the following effect: >> >> 7 >> 1. After executing Free(X), the value of X is null. >> >> 8 >> 2. Free(X), when X is already equal to null, has no effect. > > No, it is that you misunderstand me: > > Second free may be executed not as Free(X) but as Free(Y) where Y was a copy > of X (and so Free(X) sets only X to null, it does not set Y to null; and > Free(Y) would be erroneous). Ok, that makes sense. Don't copy pointers! It is the copy of the pointer that is bad, not the behavior of Unchecked_Deallocation. -- -- Stephe