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,FREEMAIL_FROM autolearn=unavailable autolearn_force=no version=3.4.4 X-Received: by 10.36.0.81 with SMTP id 78mr6790007ita.19.1519574150023; Sun, 25 Feb 2018 07:55:50 -0800 (PST) X-Received: by 10.157.83.129 with SMTP id w1mr361515otg.2.1519574149931; Sun, 25 Feb 2018 07:55:49 -0800 (PST) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!feeder.eternal-september.org!border1.nntp.ams1.giganews.com!nntp.giganews.com!peer03.ams1!peer.ams1.xlned.com!news.xlned.com!peer03.am4!peer.am4.highwinds-media.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!o66no1529632ita.0!news-out.google.com!a25ni726itj.0!nntp.google.com!o66no1529627ita.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Sun, 25 Feb 2018 07:55:49 -0800 (PST) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=71.171.117.31; posting-account=QF6XPQoAAABce2NyPxxDAaKdAkN6RgAf NNTP-Posting-Host: 71.171.117.31 References: <906cd418-adff-4eeb-9da5-7c6f7c777ff8@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: Re: Possible GNAT bug, but wanted to see if it was a violtion of the RM From: Jere Injection-Date: Sun, 25 Feb 2018 15:55:50 +0000 Content-Type: text/plain; charset="UTF-8" X-Received-Bytes: 2350 X-Received-Body-CRC: 895600584 Xref: reader02.eternal-september.org comp.lang.ada:50641 Date: 2018-02-25T07:55:49-08:00 List-Id: On Sunday, February 25, 2018 at 6:55:13 AM UTC-5, Simon Wright wrote: > Jere writes: > > > Thanks! That confirms my initial suspicion of it being related to > > tamper checks, but I can't figure out how. I looked through the GNAT > > code and saw how they locked it in the Constant_Reference function, > > but I can't for the life of me figure out how calling it using: > > > > Package.Operation(Object,Params).Discriminant > > > > would work differently than > > > > Object.Operation(Params).Discriminant > > > > for that function call. > > Compiling with -gnatG (to list an Ada-like representation of what the > compiler has transformed your code into before it starts > optimisation/code generation) shows that the Package.Operation version > includes some finalization in Operation that's missing in the > Object.Operation version. Looks very like a bug! Thank you! I wasn't aware of that switch. Admittedly it is a bit difficult to read the output for the first time, but scanning the diff I was able to see hints of what you were saying. I'll file off a bug report to AdaCore