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=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 Path: border2.nntp.dca.giganews.com!nntp.giganews.com!newspeer1.nac.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.fsmpi.rwth-aachen.de!rt.uk.eu.org!aioe.org!.POSTED!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: Implicit dereferences rational question Date: Tue, 20 May 2014 09:29:36 +0200 Organization: cbb software GmbH Message-ID: <1pkkrdwu7lh6y.7cjyncdfw33e.dlg@40tude.net> References: Reply-To: mailbox@dmitry-kazakov.de NNTP-Posting-Host: QTaafVZuunHujkJPndFR7g.user.speranza.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Complaints-To: abuse@aioe.org User-Agent: 40tude_Dialog/2.0.15.1 X-Notice: Filtered by postfilter v. 0.8.2 Xref: number.nntp.dca.giganews.com comp.lang.ada:186499 Date: 2014-05-20T09:29:36+02:00 List-Id: On Mon, 19 May 2014 16:51:56 -0500, Randy Brukardt wrote: > "Victor Porton" wrote in message > news:llb1aa$gth$1@speranza.aioe.org... >> Robert A Duff wrote: >>> Victor Porton writes: >>> >>>> Why implicit dereferences use only access discriminants, not arbitrary >>>> access fields? >>> >>> It helps prevent dangling pointers. >> >> In which way limiting to discriminants may prevent dangling pointers? > > Discriminants have a lengthy set of accessibility rules, which turn out to > be exactly what's needed for limiting dangling pointers. In particular, it's > almost never the case that one can make a copy of an access discriminant, > while that's easy for a "arbitrary access field". Except that dereference, be it implicit or explicit, does not create pointers. Obviously, it eliminates a pointer, as the name suggests. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de