public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r13-496] [Ada] Don't crash on ghost packages when emitting CUDA symbols in ALI files
@ 2022-05-16  8:44 Pierre-Marie de Rodat
  0 siblings, 0 replies; only message in thread
From: Pierre-Marie de Rodat @ 2022-05-16  8:44 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:9eb55045f8d22919c47b38809afbcad7ad9a38d5

commit r13-496-g9eb55045f8d22919c47b38809afbcad7ad9a38d5
Author: Ghjuvan Lacambre <lacambre@adacore.com>
Date:   Mon Mar 14 09:58:52 2022 +0100

    [Ada] Don't crash on ghost packages when emitting CUDA symbols in ALI files
    
    Before this commit, a GNAT compiled with assertions would crash when
    attempting to emit CUDA symbols in ALI files for spark_mode/ghost
    packages, whose content is a single null statement.
    
    gcc/ada/
    
            * lib-writ.adb (Output_CUDA_Symbols): Check for null packages.

Diff:
---
 gcc/ada/lib-writ.adb | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/gcc/ada/lib-writ.adb b/gcc/ada/lib-writ.adb
index 556df9a7b73..b525bbac0f5 100644
--- a/gcc/ada/lib-writ.adb
+++ b/gcc/ada/lib-writ.adb
@@ -403,7 +403,9 @@ package body Lib.Writ is
          Kernel_Elm  : Elmt_Id;
          Kernel      : Entity_Id;
       begin
-         if not Enable_CUDA_Expansion then
+         if not Enable_CUDA_Expansion
+           or else Nkind (Unit_Id) = N_Null_Statement
+         then
             return;
          end if;
          Spec_Id := (if Nkind (Unit_Id) = N_Package_Body


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

only message in thread, other threads:[~2022-05-16  8:44 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-16  8:44 [gcc r13-496] [Ada] Don't crash on ghost packages when emitting CUDA symbols in ALI files 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).