From: "Randy Brukardt" <randy@rrsoftware.com>
Subject: Re: Limited type in generic package causes double free or corruption
Date: Wed, 28 Sep 2016 16:42:42 -0500
Date: 2016-09-28T16:42:42-05:00 [thread overview]
Message-ID: <nshdfs$67t$1@franka.jacob-sparre.dk> (raw)
In-Reply-To: c6cae5e7-a215-4560-aa8a-d15ce4bd0852@googlegroups.com
"AdaMagica" <christ-usch.grein@t-online.de> wrote in message
news:c6cae5e7-a215-4560-aa8a-d15ce4bd0852@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.
And if the compiler is allowing it, it is wrong. Report a bug to the vendor.
Randy.
prev parent reply other threads:[~2016-09-28 21:42 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
2016-09-28 21:42 ` Randy Brukardt [this message]
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox