diff options
author | Tristan Gingold <tgingold@free.fr> | 2015-05-27 20:49:40 +0200 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2015-05-27 20:49:40 +0200 |
commit | 108a813198c4078b14ef2d69e16a34d423fa0b35 (patch) | |
tree | dace976be3de04ad8b110385eb6d5f32e68e76ac /src/vhdl/sem_decls.adb | |
parent | 45b6d0b47b3445209c64d66936117e000d6fc403 (diff) | |
download | ghdl-108a813198c4078b14ef2d69e16a34d423fa0b35.tar.gz ghdl-108a813198c4078b14ef2d69e16a34d423fa0b35.tar.bz2 ghdl-108a813198c4078b14ef2d69e16a34d423fa0b35.zip |
Fix regression for expanded names.
Diffstat (limited to 'src/vhdl/sem_decls.adb')
-rw-r--r-- | src/vhdl/sem_decls.adb | 27 |
1 files changed, 17 insertions, 10 deletions
diff --git a/src/vhdl/sem_decls.adb b/src/vhdl/sem_decls.adb index d4e60906c..5081fa3d2 100644 --- a/src/vhdl/sem_decls.adb +++ b/src/vhdl/sem_decls.adb @@ -2771,12 +2771,10 @@ package body Sem_Decls is procedure Sem_Declaration_Chain (Parent : Iir) is Decl : Iir; - Next_Decl : Iir; Attr_Spec_Chain : Iir; -- New declaration chain (declarations like implicit signals may be -- added, some like aliases may mutate). - First_Decl : Iir; Last_Decl : Iir; -- Used for list of identifiers in object declarations to get the type @@ -2798,7 +2796,7 @@ package body Sem_Decls is -- Due to implicit declarations, the list can grow during sem. Decl := Get_Declaration_Chain (Parent); - Sub_Chain_Init (First_Decl, Last_Decl); + Last_Decl := Null_Iir; Attr_Spec_Chain := Null_Iir; Last_Obj_Decl := Null_Iir; @@ -2892,18 +2890,27 @@ package body Sem_Decls is and then Current_Signals_Region.First_Implicit_Decl /= Null_Iir then -- Add pending implicit declarations before the current one. - Sub_Chain_Append_Chain (First_Decl, Last_Decl, - Current_Signals_Region.First_Implicit_Decl, - Current_Signals_Region.Last_Implicit_Decl); + if Last_Decl = Null_Iir then + Set_Declaration_Chain + (Parent, Current_Signals_Region.First_Implicit_Decl); + else + Set_Chain + (Last_Decl, Current_Signals_Region.First_Implicit_Decl); + end if; + Last_Decl := Current_Signals_Region.Last_Implicit_Decl; Sub_Chain_Init (Current_Signals_Region.First_Implicit_Decl, Current_Signals_Region.Last_Implicit_Decl); end if; - Next_Decl := Get_Chain (Decl); - Sub_Chain_Append (First_Decl, Last_Decl, Decl); - Decl := Next_Decl; + if Last_Decl = Null_Iir then + -- Append now to handle expand names. + Set_Declaration_Chain (Parent, Decl); + else + Set_Chain (Last_Decl, Decl); + end if; + Last_Decl := Decl; + Decl := Get_Chain (Decl); end loop; - Set_Declaration_Chain (Parent, First_Decl); if Current_Signals_Region.Decls_Parent = Parent then -- All declarations have been analyzed, new implicit declarations |