[gcc r11-5297] [Ada] Fix crash in GNATprove on inlined subprogram in default expression

Pierre-Marie de Rodat pmderodat@gcc.gnu.org
Tue Nov 24 10:18:24 GMT 2020


https://gcc.gnu.org/g:4f94320340e621e0b32e26f5e5b4d8883c7f8241

commit r11-5297-g4f94320340e621e0b32e26f5e5b4d8883c7f8241
Author: Yannick Moy <moy@adacore.com>
Date:   Mon Oct 5 09:05:06 2020 +0200

    [Ada] Fix crash in GNATprove on inlined subprogram in default expression
    
    gcc/ada/
    
            * sem_ch3.adb (Process_Discriminants): Correctly set right
            context for analyzing default value of discriminant.

Diff:
---
 gcc/ada/sem_ch3.adb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gcc/ada/sem_ch3.adb b/gcc/ada/sem_ch3.adb
index 269818afe38..f5c78081988 100644
--- a/gcc/ada/sem_ch3.adb
+++ b/gcc/ada/sem_ch3.adb
@@ -20093,7 +20093,7 @@ package body Sem_Ch3 is
          --  Per-Object Expressions" in spec of package Sem).
 
          if Present (Expression (Discr)) then
-            Preanalyze_Spec_Expression (Expression (Discr), Discr_Type);
+            Preanalyze_Default_Expression (Expression (Discr), Discr_Type);
 
             --  Legaity checks


More information about the Gcc-cvs mailing list