public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
From: Eric Botcazou <ebotcazou@gcc.gnu.org>
To: gcc-cvs@gcc.gnu.org
Subject: [gcc r12-972] Detect illegal conditions in Raise_xxx_Error nodes
Date: Fri, 21 May 2021 09:31:51 +0000 (GMT)	[thread overview]
Message-ID: <20210521093151.8B40C38515DD@sourceware.org> (raw)

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;
 }


                 reply	other threads:[~2021-05-21  9:31 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210521093151.8B40C38515DD@sourceware.org \
    --to=ebotcazou@gcc.gnu.org \
    --cc=gcc-cvs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).