[Ada] Prevent Get_Current_Value_Condition from returning the same node
authorBob Duff <duff@adacore.com>
Tue, 30 Nov 2021 21:00:40 +0000 (16:00 -0500)
committerPierre-Marie de Rodat <derodat@adacore.com>
Wed, 5 Jan 2022 11:32:35 +0000 (11:32 +0000)
commita6505936a35e7a5c66e36f7c4e2032c5c7f64838
tree161f8a7cce508871ac49e9bcbec33d9ece175b79
parent54403a8130c126cc3e901341dac64afbc7273347
[Ada] Prevent Get_Current_Value_Condition from returning the same node

gcc/ada/

* exp_util.ads (Get_Current_Value_Condition): Belt: Add a
postcondition that Val /= Var.
* sem_util.adb (Known_Null): Suspenders: Raise Program_Error if
Get_Current_Value_Condition returned the same value. This will
be enabled even without assertions, because infinite recursion
is a nuisance -- better to crash if this bug ever occurs.
gcc/ada/exp_util.ads
gcc/ada/sem_util.adb