* [Ada] Detect illegal conditions in Raise_xxx_Error nodes
@ 2021-05-21 9:31 Eric Botcazou
2021-05-21 9:38 ` Eric Botcazou
0 siblings, 1 reply; 2+ messages in thread
From: Eric Botcazou @ 2021-05-21 9:31 UTC (permalink / raw)
To: gcc-patches
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.
Tested on x86-64/Linux, applied on the mainline.
2021-05-21 Piotr Trojanek <trojanek@adacore.com>
* gcc-interface/trans.c (Raise_Error_to_gnu): Add an assertion.
--
Eric Botcazou
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [Ada] Detect illegal conditions in Raise_xxx_Error nodes
2021-05-21 9:31 [Ada] Detect illegal conditions in Raise_xxx_Error nodes Eric Botcazou
@ 2021-05-21 9:38 ` Eric Botcazou
0 siblings, 0 replies; 2+ messages in thread
From: Eric Botcazou @ 2021-05-21 9:38 UTC (permalink / raw)
To: gcc-patches
[-- Attachment #1: Type: text/plain, Size: 141 bytes --]
> 2021-05-21 Piotr Trojanek <trojanek@adacore.com>
>
> * gcc-interface/trans.c (Raise_Error_to_gnu): Add an assertion.
--
Eric Botcazou
[-- Attachment #2: p.diff --]
[-- Type: text/x-patch, Size: 622 bytes --]
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] 2+ messages in thread
end of thread, other threads:[~2021-05-21 9:38 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-21 9:31 [Ada] Detect illegal conditions in Raise_xxx_Error nodes Eric Botcazou
2021-05-21 9:38 ` 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).