public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r12-2214] [Ada] Crash on expansion of BIP construct in -gnatf mode
@ 2021-07-09 12:39 Pierre-Marie de Rodat
  0 siblings, 0 replies; only message in thread
From: Pierre-Marie de Rodat @ 2021-07-09 12:39 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:66d43665bc9c8a8f38531a8b9a02cfcfe129cc88

commit r12-2214-g66d43665bc9c8a8f38531a8b9a02cfcfe129cc88
Author: Justin Squirek <squirek@adacore.com>
Date:   Tue Jun 15 12:54:12 2021 -0400

    [Ada] Crash on expansion of BIP construct in -gnatf mode
    
    gcc/ada/
    
            * exp_ch6.adb (Is_Build_In_Place_Function_Call): Add check to
            verify the Selector_Name of Exp_Node has been analyzed before
            obtaining its entity.

Diff:
---
 gcc/ada/exp_ch6.adb | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/gcc/ada/exp_ch6.adb b/gcc/ada/exp_ch6.adb
index 1c56cb8b1d5..59704a4065c 100644
--- a/gcc/ada/exp_ch6.adb
+++ b/gcc/ada/exp_ch6.adb
@@ -8275,6 +8275,15 @@ package body Exp_Ch6 is
       --  This may be a call to a protected function.
 
       elsif Nkind (Name (Exp_Node)) = N_Selected_Component then
+         --  The selector in question might not have been analyzed due to a
+         --  previous error, so analyze it here to output the appropriate
+         --  error message instead of crashing when attempting to fetch its
+         --  entity.
+
+         if not Analyzed (Selector_Name (Name (Exp_Node))) then
+            Analyze (Selector_Name (Name (Exp_Node)));
+         end if;
+
          Function_Id := Etype (Entity (Selector_Name (Name (Exp_Node))));
 
       else


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-07-09 12:39 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-09 12:39 [gcc r12-2214] [Ada] Crash on expansion of BIP construct in -gnatf mode Pierre-Marie de Rodat

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).