aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorPiotr Trojanek <trojanek@adacore.com>2021-05-21 11:30:26 +0200
committerEric Botcazou <ebotcazou@adacore.com>2021-05-21 11:31:46 +0200
commit6fdacaf4b00619ad139ecf101cbb0136dcdd8c3a (patch)
tree13d66265674d1c3dc240393e66ae4c2509232aa4 /gcc
parent745dae5923aba02982563481d75a21595df22ff8 (diff)
downloadgcc-6fdacaf4b00619ad139ecf101cbb0136dcdd8c3a.zip
gcc-6fdacaf4b00619ad139ecf101cbb0136dcdd8c3a.tar.gz
gcc-6fdacaf4b00619ad139ecf101cbb0136dcdd8c3a.tar.bz2
Detect illegal conditions in Raise_xxx_Error nodes
Enforce comment from sinfo.ads about the Condition field in N_Raise_xxx_Error nodes. Only an extra sanity check; the behaviour is not affected. gcc/ada/ * gcc-interface/trans.c (Raise_Error_to_gnu): Add an assertion.
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ada/gcc-interface/trans.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/gcc/ada/gcc-interface/trans.c b/gcc/ada/gcc-interface/trans.c
index 289a2ef..ee014a3 100644
--- a/gcc/ada/gcc-interface/trans.c
+++ b/gcc/ada/gcc-interface/trans.c
@@ -6159,7 +6159,12 @@ Raise_Error_to_gnu (Node_Id gnat_node, tree *gnu_result_type_p)
}
}
else
- gnu_result = build1 (NULL_EXPR, *gnu_result_type_p, gnu_result);
+ {
+ /* The condition field must not be present when the node is used as an
+ expression form. */
+ gigi_checking_assert (No (gnat_cond));
+ gnu_result = build1 (NULL_EXPR, *gnu_result_type_p, gnu_result);
+ }
return gnu_result;
}