aboutsummaryrefslogtreecommitdiff
path: root/libcpp/include/cpplib.h
diff options
context:
space:
mode:
authorBob Duff <duff@adacore.com>2025-07-23 14:46:13 -0400
committerMarc Poulhiès <dkm@gcc.gnu.org>2025-08-04 15:04:11 +0200
commitb0e249afc68917375d5117ff674f80aeb93d051c (patch)
tree16c69480e8bc4cf3775d86915ab56681ac54e6a2 /libcpp/include/cpplib.h
parent0f048a684052e151741269642a1ea8111ff63b96 (diff)
downloadgcc-b0e249afc68917375d5117ff674f80aeb93d051c.zip
gcc-b0e249afc68917375d5117ff674f80aeb93d051c.tar.gz
gcc-b0e249afc68917375d5117ff674f80aeb93d051c.tar.bz2
ada: Make pp and friends more robust
Print_Node_Ref, which is called by pp, sometimes calls Compile_Time_Known_Value, which blows up if Entity (N) is empty. Rearrange the tests here, and test for Present (Entity (N)) before calling Compile_Time_Known_Value. Remove test "Nkind (N) in N_Subexpr", which is redundant with other tests. We don't want to make Compile_Time_Known_Value more robust; you shouldn't call it on half-baked nodes. But ideally pp should be able to print such nodes. This change fixes one of many such cases. gcc/ada/ChangeLog: * treepr.adb (Print_Node_Ref): Protect against Entity (N) being empty before calling Compile_Time_Known_Value.
Diffstat (limited to 'libcpp/include/cpplib.h')
0 files changed, 0 insertions, 0 deletions