[Ada] Crash in class-wide pre/postconditions
authorJavier Miranda <miranda@adacore.com>
Mon, 29 Nov 2021 18:12:47 +0000 (18:12 +0000)
committerPierre-Marie de Rodat <derodat@adacore.com>
Thu, 6 Jan 2022 17:11:31 +0000 (17:11 +0000)
commitbfbb8de66079be551f08cdab38cafa766bb29e78
tree7919ecc7cf1cd2ee947d2667ec2777fa684901c6
parent2a3652640b612c1e7619dfa10c096f3adc750b41
[Ada] Crash in class-wide pre/postconditions

gcc/ada/

* contracts.adb (Restore_Original_Selected_Component): New
subprogram that traverses a preanalyzed expression searching for
dispatching calls to functions whose original node was a
selected component, and replacing them with their original node.
This functionality is required because the preanalyis of
dispatching calls using the Object.Operation notation transforms
such calls, and we need the original condition to properly
inherit and extend the condition expression on tagged type
derivations.  This functionality was previously provided by the
routine Install_Original_Selected_Component (as part of
inheriting conditions); now it is performed as part of the
preanalysis of the condition, thus avoiding repeatedly
installing and restoring such nodes.
(Install_Original_Selected_Component): Removed.
(Restore_Dispatching_Calls): Removed.
gcc/ada/contracts.adb