This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Ada] Frontend crash processing tagged type conversion


The compiler crashes proocessing the type conversion of
a access type whose accessibility level is wrong. The
following test must compile without errors.

package Prime is end;

package PRIME.Objects is
   type Root is tagged null record;

   type Object_Ref is tagged record
      Ptr : access Root'Class;
   end record;

   generic
      type Object (<>) is new Root with private;
      type Object_Ptr is access all Object'Class;
   function Get_Object (Ref : Object_Ref) return Object_Ptr;
end;

with PRIME.Objects; use PRIME.Objects;
package Prime.Test_Objects is
   type DT     is new Root with null record;
   type DT_Ptr is access all DT'Class;

   function Get_DT is new Get_Object (DT, DT_Ptr);
end;

package body PRIME.Objects is
   function Get_Object (Ref : Object_Ref) return Object_Ptr is
   begin
      return Object_Ptr (Ref.Ptr); -- test
   end Get_Object;
end;

with Prime.Test_Objects;
procedure My_Test is begin null; end;

Command: gnatmake -gnat05 my_test.adb

Tested on x86_64-pc-linux-gnu, committed on trunk

2009-06-24  Javier Miranda  <miranda@adacore.com>

	* exp_ch4.adb (Expand_N_Type_Conversion): return immediately
	from processing the type conversion when the node is
	replaced by an N_Raise_Program_Error node.

Attachment: difs
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]