diff options
author | Tristan Gingold | 2015-11-24 06:59:24 +0100 |
---|---|---|
committer | Tristan Gingold | 2015-11-24 06:59:24 +0100 |
commit | d8667fd831a8281cdbc362e129a95db78010ffbc (patch) | |
tree | c2924a0caf31fd862de85e7dceb8eb87d4e02c4f | |
parent | 3a9c90b39150a636c27b362ab01b6090a213455c (diff) | |
download | ghdl-d8667fd831a8281cdbc362e129a95db78010ffbc.tar.gz ghdl-d8667fd831a8281cdbc362e129a95db78010ffbc.tar.bz2 ghdl-d8667fd831a8281cdbc362e129a95db78010ffbc.zip |
Fix a crash on conflict in under interpretation.
-rw-r--r-- | src/vhdl/sem_scopes.adb | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/src/vhdl/sem_scopes.adb b/src/vhdl/sem_scopes.adb index 4add633..a31279c 100644 --- a/src/vhdl/sem_scopes.adb +++ b/src/vhdl/sem_scopes.adb @@ -326,8 +326,14 @@ package body Sem_Scopes is Cell : Interpretation_Cell renames Interpretations.Table (Inter); Prev : constant Name_Interpretation_Type := Cell.Prev; begin + -- Get_Under_Interpretation can be used only to get a hidden + -- interpretation. pragma Assert (Cell.Prev_Hidden); - if Valid_Interpretation (Prev) then + + if Valid_Interpretation (Prev) + -- Not a conflict one (use clauses). + and then Get_Declaration (Prev) /= Null_Iir + then return Prev; else return No_Name_Interpretation; @@ -1395,10 +1401,14 @@ package body Sem_Scopes is end if; Put (": "); Decl := Get_Declaration (Inter); - Put (Iir_Kind'Image (Get_Kind (Decl))); - Put_Line (", loc: " & Image (Get_Location (Decl))); - if Get_Kind (Decl) in Iir_Kinds_Subprogram_Declaration then - Put_Line (" " & Disp_Subprg (Decl)); + if Decl = Null_Iir then + Put_Line ("null: conflict"); + else + Put (Iir_Kind'Image (Get_Kind (Decl))); + Put_Line (", loc: " & Image (Get_Location (Decl))); + if Get_Kind (Decl) in Iir_Kinds_Subprogram_Declaration then + Put_Line (" " & Disp_Subprg (Decl)); + end if; end if; end Dump_Interpretation; |