]> git.ipfire.org Git - thirdparty/gcc.git/commit
ada: Fix crash with -gnatyB and -gnatdJ
authorRonan Desplanques <desplanques@adacore.com>
Fri, 2 Feb 2024 17:08:57 +0000 (18:08 +0100)
committerMarc Poulhiès <poulhies@adacore.com>
Tue, 14 May 2024 08:19:51 +0000 (10:19 +0200)
commit821772478bdc8cb52249aa561975e4ff6aa7792f
tree283d2d229c67b38a77a25ccae00fecb172efaa71
parent4dd6f75e35065f2f0732c4cfbaf412b50c51e26e
ada: Fix crash with -gnatyB and -gnatdJ

The crash this patch fixes happened because calling the Errout.Error_Msg
procedures that don't have an N parameter is not allowed when not
parsing and -gnatdJ is on. And -gnatyB style checks are not emitted during
parsing but during semantic analysis.

This commit moves Check_Boolean_Operator from Styleg to Style so it can
call Errout.Error_Msg with a Node_Id parameter. This change of package
makes sense because:

1. The compiler is currently the only user of Check_Boolean_Operator.
2. Other tools don't do semantic analysis, and so cannot possibly
know when to use Check_Boolean_Operator anyway.

gcc/ada/

* styleg.ads (Check_Boolean_Operator): Moved ...
* style.ads (Check_Boolean_Operator): ... here.
* styleg.adb (Check_Boolean_Operator): Moved ...
* style.adb (Check_Boolean_Operator): ... here. Also add node
parameter to call to Errout.Error_Msg.
gcc/ada/style.adb
gcc/ada/style.ads
gcc/ada/styleg.adb
gcc/ada/styleg.ads