comp.lang.ada
 help / color / mirror / Atom feed
From: AdaMagica <christ-usch.grein@t-online.de>
Subject: Re: Limited type in generic package causes double free or corruption
Date: Wed, 28 Sep 2016 10:34:36 -0700 (PDT)
Date: 2016-09-28T10:34:36-07:00	[thread overview]
Message-ID: <c6cae5e7-a215-4560-aa8a-d15ce4bd0852@googlegroups.com> (raw)
In-Reply-To: <374b0d79-541d-44d2-886e-dd41f8815914@googlegroups.com>

Am Mittwoch, 28. September 2016 15:26:02 UTC+2 schrieb onox:
>    function Load_Thing return Thing is
>    begin
>       return Object : Thing := (My_Tree => Trees.Create_Tree) do
>          null;
>       end return;
>    end Load_Thing;
You can return *new* limited objects - they are created in-place.

>    --  If Trees.Tree (A.Tree) is limited, shouldn't this function be disallowed?
>    function Get_Tree (Object : Thing) return Trees.Tree is
>      (Object.My_Tree);
Correct, this should not compile - you cannot return existing limited objects.

  parent reply	other threads:[~2016-09-28 17:34 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-28 13:25 Limited type in generic package causes double free or corruption onox
2016-09-28 16:06 ` Dmitry A. Kazakov
2016-09-28 16:20 ` Jeffrey R. Carter
2016-09-28 18:41   ` onox
2016-09-28 19:51     ` Jeffrey R. Carter
2016-09-29  8:12     ` Alejandro R. Mosteo
2016-09-28 17:27 ` Anh Vo
2016-09-28 17:34 ` AdaMagica [this message]
2016-09-28 21:42   ` Randy Brukardt
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox