[Bug ada/46256] New: Combination of protected type, interfaces and unchecked deallocation causes the compiler to crash.

prog at msobczak dot com gcc-bugzilla@gcc.gnu.org
Sun Oct 31 21:27:00 GMT 2010


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46256

           Summary: Combination of protected type, interfaces and
                    unchecked deallocation causes the compiler to crash.
           Product: gcc
           Version: 4.3.4
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: ada
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: prog@msobczak.com


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;

Uncommenting the indicated line causes all known compiler versions to crash
with internal error.



More information about the Gcc-bugs mailing list