diff mbox series

[Ada] Crash on generic subprogram with aspect No_Return.

Message ID 20170906100611.GA30595@adacore.com
State New
Headers show
Series [Ada] Crash on generic subprogram with aspect No_Return. | expand

Commit Message

Arnaud Charlet Sept. 6, 2017, 10:06 a.m. UTC
This patch fixes a compiler abort on a generic unit to which the aspect
No_Return applies.

Tested in ACATS 4.1D C651002.

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

2017-09-06  Ed Schonberg  <schonberg@adacore.com>

	* freeze.adb (Freeze_Entity): Do not generate a freeze
	node for a generic unit, even if it includes delayed aspect
	specifications. Freeze nodes for generic entities must never
	appear in the tree that reaches the back-end of the compiler.
diff mbox series

Patch

Index: freeze.adb
===================================================================
--- freeze.adb	(revision 251765)
+++ freeze.adb	(working copy)
@@ -5489,6 +5489,13 @@ 
             then
                Explode_Initialization_Compound_Statement (E);
             end if;
+
+            --  Do not generate a freeze node for a generic unit.
+
+            if Is_Generic_Unit (E) then
+               Result := No_List;
+               goto Leave;
+            end if;
          end if;
 
       --  Case of a type or subtype being frozen