]> git.ipfire.org Git - thirdparty/gcc.git/commit
ada: Compiler goes into loop
authorSteve Baird <baird@adacore.com>
Fri, 3 May 2024 23:50:00 +0000 (16:50 -0700)
committerMarc Poulhiès <poulhies@adacore.com>
Thu, 13 Jun 2024 13:30:36 +0000 (15:30 +0200)
commit3b4d5b340a861b29eff40811c6c6638f54c28bf6
tree16ce8110722f9c0223df2a5213d55b8e6e925cf1
parent98900f7da7969cdc241cf1f6a85127e75f852607
ada: Compiler goes into loop

In some cases that are difficult to characterize, the compiler fails an
assertion check (if the compiler is built with assertions enabled) or
loops forever (if assertions are not enabled). One way this can happen is if
Exp_Util.Insert_Actions is called with an N_Itype_Reference node as its first
parameter. This, in turn, can happen when an instance of
Exp_Attr.Expand_N_Attribute_Reference.Built_And_Insert_Type_Attr_Subp
calls Insert_Action (which will call Insert_Actions).

gcc/ada/

* exp_util.adb
(Insert_Actions): Code was relying on an incorrect assumption that an
N_Itype_Reference cannot occur in declaration list or a statement
list.  Fix the code to handle this case.
gcc/ada/exp_util.adb