[Ada] Crash in class-wide pre/postconditions
authorJavier Miranda <miranda@adacore.com>
Fri, 17 Dec 2021 16:43:57 +0000 (16:43 +0000)
committerPierre-Marie de Rodat <derodat@adacore.com>
Fri, 7 Jan 2022 16:24:14 +0000 (16:24 +0000)
commit2eed8f16bfefbf50d991419cc11fe9a0e2122aa8
tree0348cf267081ac448c0616d726ea41bb60d304dd
parent7f4e820d3bb5b65eab4c5693bdbe0cbe5877cd85
[Ada] Crash in class-wide pre/postconditions

gcc/ada/

* atree.ads (Traverse_Func_With_Parent): New generic subprogram.
(Traverse_Proc_With_Parent): Likewise.
* atree.adb (Parents_Stack): New table used to traverse trees
passing the parent field of each node.
(Internal_Traverse_With_Parent): New generic subprogram.
(Traverse_Func_With_Parent): Likewise.
(Traverse_Proc_With_Parent): Likewise.
* contracts.adb (Fix_Parents): New subprogram.
(Restore_Original_Selected_Component): Enhanced to fix the
parent field of restored nodes.
(Inherit_Condition): Adding assertions to check the parent field
of inherited conditions and to ensure that the built inherited
condition has no reference to the formals of the parent
subprogram.
* sem_util.ads, sem_util.adb (Check_Parents): New subprogram.
gcc/ada/atree.adb
gcc/ada/atree.ads
gcc/ada/contracts.adb
gcc/ada/sem_util.adb
gcc/ada/sem_util.ads