comp.lang.ada
 help / color / mirror / Atom feed
* GNAT bug - still in 2010?
@ 2010-10-27 15:00 Maciej Sobczak
  2010-10-27 16:11 ` Alexander S. Mentis
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Maciej Sobczak @ 2010-10-27 15:00 UTC (permalink / raw)


Consider:

with Ada.Unchecked_Deallocation;

procedure Test is

   package P is
      type My_Interface is limited interface;
      procedure Do_Something (X : in out My_Interface) is abstract;
   end P;

   protected type My_Protected is new P.My_Interface with
      overriding
      procedure Do_Something;
   end My_Protected;

   protected body My_Protected is
      overriding
      procedure Do_Something is
      begin
         null;
      end Do_Something;
   end My_Protected;

   type My_Protected_Ptr is access My_Protected;

   procedure Free is new Ada.Unchecked_Deallocation
     (Object => My_Protected, Name => My_Protected_Ptr);

   Ptr : My_Protected_Ptr;

begin
   --   here come dragons:
   --Free (Ptr);
   null;
end Test;


If the indicated line (call to Free) is uncommented, GNAT crashes in
flames (GNAT BUG DETECTED).

I was finally able to reduce this to a minimal example, which might be
a good candidate for bug report (one in the long series of bugs
related to interfaces), but before I submit it I would like to kindly
ask you to confirm if this is still the case with GNAT 2010.
Certainly the bug is in versions GPL 2009 (20090519) and in 4.4.0
20080314.

--
Maciej Sobczak * http://www.inspirel.com



^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2010-11-01  9:23 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-10-27 15:00 GNAT bug - still in 2010? Maciej Sobczak
2010-10-27 16:11 ` Alexander S. Mentis
2010-10-27 20:43   ` Maciej Sobczak
2010-10-31 21:24     ` Maciej Sobczak
2010-11-01  9:23       ` Maciej Sobczak
2010-10-27 21:09 ` Georg Bauhaus
2010-10-27 21:21   ` Maciej Sobczak
2010-10-27 21:56     ` Simon Wright
2010-10-28  8:31       ` Maciej Sobczak
2010-10-28  7:17 ` Timo Warns

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