comp.lang.ada
 help / color / mirror / Atom feed
From: Maciej Sobczak <see.my.homepage@gmail.com>
Subject: GNAT bug - still in 2010?
Date: Wed, 27 Oct 2010 08:00:44 -0700 (PDT)
Date: 2010-10-27T08:00:44-07:00	[thread overview]
Message-ID: <6cebf1a3-3b2a-4e79-a39e-669a6a5ca00c@l20g2000yqm.googlegroups.com> (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



             reply	other threads:[~2010-10-27 15:00 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-27 15:00 Maciej Sobczak [this message]
2010-10-27 16:11 ` GNAT bug - still in 2010? 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
replies disabled

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