aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2015-03-14 07:25:50 +0100
committerTristan Gingold <tgingold@free.fr>2015-03-14 07:25:50 +0100
commitc38d446c4d9c4fb304f29f15a89c3959b5a883ba (patch)
tree9e4598057c4df19135146d9348ad24ba08b1e5c7
parent2b0e6f09e32471c1b5a169c3ede4d0b8362cd80a (diff)
downloadghdl-c38d446c4d9c4fb304f29f15a89c3959b5a883ba.tar.gz
ghdl-c38d446c4d9c4fb304f29f15a89c3959b5a883ba.tar.bz2
ghdl-c38d446c4d9c4fb304f29f15a89c3959b5a883ba.zip
procedure call: avoid crash with individual associations and signals.
-rw-r--r--src/vhdl/sem_expr.adb45
1 files changed, 25 insertions, 20 deletions
diff --git a/src/vhdl/sem_expr.adb b/src/vhdl/sem_expr.adb
index 5b4ed6b58..b7a04d9e8 100644
--- a/src/vhdl/sem_expr.adb
+++ b/src/vhdl/sem_expr.adb
@@ -1487,27 +1487,32 @@ package body Sem_Expr is
Param := Parameters_Chain;
Inter := Get_Interface_Declaration_Chain (Imp);
while Param /= Null_Iir loop
- Formal := Get_Formal (Param);
- if Formal = Null_Iir then
- Formal := Inter;
- Inter := Get_Chain (Inter);
- else
- Formal := Get_Base_Name (Formal);
- Inter := Null_Iir;
- end if;
- if Get_Kind (Formal) = Iir_Kind_Interface_Signal_Declaration
- and then Get_Mode (Formal) in Iir_Out_Modes
+ -- Association_Element_By_Individual duplicates existing
+ -- associations.
+ if Get_Kind (Param) /= Iir_Kind_Association_Element_By_Individual
then
- Prefix := Name_To_Object (Get_Actual (Param));
- if Prefix /= Null_Iir then
- case Get_Kind (Get_Object_Prefix (Prefix)) is
- when Iir_Kind_Signal_Declaration
- | Iir_Kind_Interface_Signal_Declaration =>
- Prefix := Get_Longuest_Static_Prefix (Prefix);
- Sem_Stmts.Sem_Add_Driver (Prefix, Stmt);
- when others =>
- null;
- end case;
+ Formal := Get_Formal (Param);
+ if Formal = Null_Iir then
+ Formal := Inter;
+ Inter := Get_Chain (Inter);
+ else
+ Formal := Get_Base_Name (Formal);
+ Inter := Null_Iir;
+ end if;
+ if Get_Kind (Formal) = Iir_Kind_Interface_Signal_Declaration
+ and then Get_Mode (Formal) in Iir_Out_Modes
+ then
+ Prefix := Name_To_Object (Get_Actual (Param));
+ if Prefix /= Null_Iir then
+ case Get_Kind (Get_Object_Prefix (Prefix)) is
+ when Iir_Kind_Signal_Declaration
+ | Iir_Kind_Interface_Signal_Declaration =>
+ Prefix := Get_Longuest_Static_Prefix (Prefix);
+ Sem_Stmts.Sem_Add_Driver (Prefix, Stmt);
+ when others =>
+ null;
+ end case;
+ end if;
end if;
end if;
Param := Get_Chain (Param);