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!.POSTED!not-for-mail From: "Alejandro R. Mosteo" Newsgroups: comp.lang.ada Subject: Re: Limited type in generic package causes double free or corruption Date: Thu, 29 Sep 2016 10:12:06 +0200 Organization: A noiseless patient Spider Message-ID: References: <374b0d79-541d-44d2-886e-dd41f8815914@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Thu, 29 Sep 2016 08:11:56 -0000 (UTC) Injection-Info: mx02.eternal-september.org; posting-host="65830921499fe3b3a7755169742ded44"; logging-data="4778"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/W8WWjoH5+mXHN7DqiA0PJ" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.3.0 In-Reply-To: Cancel-Lock: sha1:AMQgn87GTb3vRl20dACn/jNWjfw= Xref: news.eternal-september.org comp.lang.ada:31944 Date: 2016-09-29T10:12:06+02:00 List-Id: On 28/09/16 20:41, onox wrote: > If Tree is tagged (which it is), doesn't that mean Ada uses copy-by-reference instead of copy-by-value. Or am I mixing things up here? Copy is never by reference in Ada (other than when explicitly using access types, of course). You're perhaps thinking of the parameter-passing mechanism? That's indeed by reference for tagged types (although for the programmer the allowed operations are as per the in/out mode as usual).