aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2022-06-01 07:58:33 +0200
committerTristan Gingold <tgingold@free.fr>2022-06-01 07:58:33 +0200
commitfa9accdf75b7e41179f9dc60ce44ab7db4349985 (patch)
treee72c6e2a8c3a0fbeca35f4336b9cdaf96ad67c05
parentd6d94cd960f0d28b49e84eca2a3f5451a5d0a4af (diff)
downloadghdl-fa9accdf75b7e41179f9dc60ce44ab7db4349985.tar.gz
ghdl-fa9accdf75b7e41179f9dc60ce44ab7db4349985.tar.bz2
ghdl-fa9accdf75b7e41179f9dc60ce44ab7db4349985.zip
vhdl-utils(is_copyback_parameter): avoid a crash on file parameter
-rw-r--r--src/vhdl/vhdl-utils.adb8
1 files changed, 2 insertions, 6 deletions
diff --git a/src/vhdl/vhdl-utils.adb b/src/vhdl/vhdl-utils.adb
index 8123e27f6..2d36c07ad 100644
--- a/src/vhdl/vhdl-utils.adb
+++ b/src/vhdl/vhdl-utils.adb
@@ -678,12 +678,8 @@ package body Vhdl.Utils is
function Is_Copyback_Parameter (Inter : Iir) return Boolean is
begin
- case Iir_Parameter_Modes (Get_Mode (Inter)) is
- when Iir_In_Mode =>
- return False;
- when Iir_Out_Mode | Iir_Inout_Mode =>
- return Get_Kind (Inter) = Iir_Kind_Interface_Variable_Declaration;
- end case;
+ return Get_Kind (Inter) = Iir_Kind_Interface_Variable_Declaration
+ and then Get_Mode (Inter) in Iir_Out_Mode .. Iir_Inout_Mode;
end Is_Copyback_Parameter;
function Find_Name_In_Flist (List : Iir_Flist; Lit : Name_Id) return Iir