From 3b45e4600aa046b3979798737b1aa3090f2070c3 Mon Sep 17 00:00:00 2001
From: Tristan Gingold <tgingold@free.fr>
Date: Sun, 26 Jul 2020 16:38:07 +0200
Subject: ortho/debug: check subtype for array subtype.

---
 src/ortho/debug/ortho_debug.adb | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/src/ortho/debug/ortho_debug.adb b/src/ortho/debug/ortho_debug.adb
index 3617ebbc8..58e46b098 100644
--- a/src/ortho/debug/ortho_debug.adb
+++ b/src/ortho/debug/ortho_debug.adb
@@ -786,14 +786,11 @@ package body Ortho_Debug is
       --  The element must either be ATYPE element or a constrained subtype
       --  of it.
       if El_Type /= Atype.El_Type then
-         if El_Type.Kind = ON_Array_Subtype then
-            if El_Type.Arr_Base /= Atype.El_Type then
-               raise Type_Error;
-            end if;
-         else
+         if Get_Base_Type (El_Type) /= Atype.El_Type then
             raise Type_Error;
          end if;
       end if;
+      Check_Constrained_Type (El_Type);
 
       return new O_Tnode_Sub_Array'(Kind => ON_Array_Subtype,
                                     Decl => O_Dnode_Null,
-- 
cgit v1.2.3