https://gcc.gnu.org/g:f5f358c6c5d55944897120c4df712ff3efd3cf08

commit r17-5194-gf5f358c6c5d55944897120c4df712ff3efd3cf08
Author: Eric Botcazou <[email protected]>
Date:   Wed Oct 14 13:52:19 2026 +0200

    Ada: Fix assertion failure in Make_Class_Precondition_Subps
    
    Build_Class_Condition_Subprograms calls Make_Class_Precondition_Subps on
    Is_Primitive_Wrapper subprograms too.
    
    gcc/ada/
            PR ada/127880
            * contracts.adb (Make_Class_Precondition_Subps): Accept another
            kind of wrapper subprograms.

Diff:
---
 gcc/ada/contracts.adb | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/gcc/ada/contracts.adb b/gcc/ada/contracts.adb
index fb781fd6ac33..1e97e71b176f 100644
--- a/gcc/ada/contracts.adb
+++ b/gcc/ada/contracts.adb
@@ -4246,7 +4246,8 @@ package body Contracts is
       then
          pragma Assert
            (Comes_From_Source (Subp_Id)
-              or else Is_Dispatch_Table_Wrapper (Subp_Id));
+             or else Is_Dispatch_Table_Wrapper (Subp_Id)
+             or else Is_Primitive_Wrapper (Subp_Id));
 
          if No (Dynamic_Call_Helper (Subp_Id)) then

Reply via email to