aboutsummaryrefslogtreecommitdiff
path: root/gcc/alloc-pool.h
diff options
context:
space:
mode:
authorSteve Baird <baird@adacore.com>2023-12-06 16:06:28 -0800
committerMarc Poulhiès <poulhies@adacore.com>2024-01-09 14:13:30 +0100
commit85f0ae3c54ad48e62ca02e61a1aa1ab3c8664142 (patch)
treef4dd6bd9d3d61b6a5fcb1370660b6587b0262850 /gcc/alloc-pool.h
parentc1ebec34788353bf126a1df1c75e1ee2110c8795 (diff)
downloadgcc-85f0ae3c54ad48e62ca02e61a1aa1ab3c8664142.zip
gcc-85f0ae3c54ad48e62ca02e61a1aa1ab3c8664142.tar.gz
gcc-85f0ae3c54ad48e62ca02e61a1aa1ab3c8664142.tar.bz2
ada: Error compiling Ada 2022 object renaming with no subtype mark
In some cases the compiler would crash or generate spurious errors compiling a legal object renaming declaration that lacks a subtype mark. In addition to fixing the immediate problem, change Atree.Copy_Slots so that attempts to modify either the Empty or the Error nodes (e.g., by passing one of them as the target in a call to Rewrite) are ineffective. Cope with the consequences of this. gcc/ada/ * sem_ch8.adb (Check_Constrained_Object): Before updating the subtype mark of an object renaming declaration by calling Rewrite, first check whether the destination of the Rewrite call exists. * atree.adb (Copy_Slots): Return without performing any updates if Destination equals Empty or Error, or if Source equals Empty. Any of those conditions indicates an error case. * sem_ch12.adb (Analyze_Formal_Derived_Type): Avoid cascading errors. * sem_ch3.adb (Analyze_Number_Declaration): In an error case, do not pass Error as destination in a call to Rewrite. (Find_Type_Of_Subtype_Indic): In an error case, do not pass Error or Empty as destination in a call to Rewrite.
Diffstat (limited to 'gcc/alloc-pool.h')
0 files changed, 0 insertions, 0 deletions