[Ada] Fix crash on pragma Compile_Time_Warning/Error
authorBob Duff <duff@adacore.com>
Wed, 17 Nov 2021 17:06:32 +0000 (12:06 -0500)
committerPierre-Marie de Rodat <derodat@adacore.com>
Wed, 1 Dec 2021 10:24:42 +0000 (10:24 +0000)
commit9ce9322ccc4aa873d732554c895b821c90017511
tree69b03b618571ed93051cc44127733e7c985d7545
parent1010cb00c8bac6a35f3fad9fa54d2e4cab2a38ef
[Ada] Fix crash on pragma Compile_Time_Warning/Error

gcc/ada/

* sem_prag.adb (Process_Compile_Time_Warning_Or_Error): Do not
follow the Corresponding_Spec pointer if Acts_As_Spec is True,
because Corresponding_Spec is Empty in that case, so we would
exit the loop prematurely, and incorrectly think we are not
inside a generic unit when we are.
gcc/ada/sem_prag.adb