diff options
| author | Tristan Gingold <tgingold@free.fr> | 2021-05-16 10:17:42 +0200 | 
|---|---|---|
| committer | Tristan Gingold <tgingold@free.fr> | 2021-05-16 10:17:42 +0200 | 
| commit | 506cd567d1794415f3d28ca6af72c91c4859b77a (patch) | |
| tree | 8bfa6a0500b2fe9894722b3bcbc8e4ffbaf6f271 /src | |
| parent | 15d517f38815e8c26e2459a8a2f3ffaa45887807 (diff) | |
| download | ghdl-506cd567d1794415f3d28ca6af72c91c4859b77a.tar.gz ghdl-506cd567d1794415f3d28ca6af72c91c4859b77a.tar.bz2 ghdl-506cd567d1794415f3d28ca6af72c91c4859b77a.zip  | |
vhdl-utils: an object alias may not have a subtype indication.  Fix #1765
Diffstat (limited to 'src')
| -rw-r--r-- | src/vhdl/vhdl-utils.adb | 15 | 
1 files changed, 10 insertions, 5 deletions
diff --git a/src/vhdl/vhdl-utils.adb b/src/vhdl/vhdl-utils.adb index 578576e1e..46c9bcd72 100644 --- a/src/vhdl/vhdl-utils.adb +++ b/src/vhdl/vhdl-utils.adb @@ -1088,11 +1088,16 @@ package body Vhdl.Utils is              | Iir_Kind_Interface_Variable_Declaration              | Iir_Kind_Interface_Signal_Declaration              | Iir_Kind_Object_Alias_Declaration => -            if (Get_Kind (Get_Subtype_Indication (Base)) -                = Iir_Kind_Subtype_Attribute) -            then -               return True; -            end if; +            declare +               Ind : constant Iir := Get_Subtype_Indication (Base); +            begin +               --  Note: an object alias may not have subtype indication. +               if Ind /= Null_Iir +                 and then Get_Kind (Ind) = Iir_Kind_Subtype_Attribute +               then +                  return True; +               end if; +            end;           when Iir_Kind_Dereference              | Iir_Kind_Implicit_Dereference =>              null;  | 
