public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r12-972] Detect illegal conditions in Raise_xxx_Error nodes
@ 2021-05-21 9:31 Eric Botcazou
0 siblings, 0 replies; only message in thread
From: Eric Botcazou @ 2021-05-21 9:31 UTC (permalink / raw)
To: gcc-cvs
https://gcc.gnu.org/g:6fdacaf4b00619ad139ecf101cbb0136dcdd8c3a
commit r12-972-g6fdacaf4b00619ad139ecf101cbb0136dcdd8c3a
Author: Piotr Trojanek <trojanek@adacore.com>
Date: Fri May 21 11:30:26 2021 +0200
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.
Diff:
---
gcc/ada/gcc-interface/trans.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/gcc/ada/gcc-interface/trans.c b/gcc/ada/gcc-interface/trans.c
index 289a2efcaf1..ee014a35cc2 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;
}
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2021-05-21 9:31 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-21 9:31 [gcc r12-972] Detect illegal conditions in Raise_xxx_Error nodes Eric Botcazou
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).