aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2020-07-28 22:30:54 +0200
committerTristan Gingold <tgingold@free.fr>2020-07-28 22:30:54 +0200
commit03bf6579771e3ec70b2ead74b9bc159d655b6c26 (patch)
treefd4cfb337989db3c8626e7ac286c747cdeaf555e
parent56b37b711ab456b7287d03b1b03fe258eda24c16 (diff)
downloadghdl-03bf6579771e3ec70b2ead74b9bc159d655b6c26.tar.gz
ghdl-03bf6579771e3ec70b2ead74b9bc159d655b6c26.tar.bz2
ghdl-03bf6579771e3ec70b2ead74b9bc159d655b6c26.zip
trans-chap8: avoid to create slice type too late.
-rw-r--r--src/vhdl/translate/trans-chap8.adb10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/vhdl/translate/trans-chap8.adb b/src/vhdl/translate/trans-chap8.adb
index 5d662f410..1e7bb1956 100644
--- a/src/vhdl/translate/trans-chap8.adb
+++ b/src/vhdl/translate/trans-chap8.adb
@@ -2594,6 +2594,16 @@ package body Trans.Chap8 is
Act_Type := Get_Type (Actual);
end case;
+ -- If the actual is a slice, create the type early so that they
+ -- could be used in different states. If they are created too
+ -- late, they could be created in a state but referenced in
+ -- a different one.
+ if Actual /= Null_Iir
+ and then Get_Kind (Actual) = Iir_Kind_Slice_Name
+ then
+ Chap3.Create_Composite_Subtype (Act_Type, False);
+ end if;
+
-- For out or inout scalar variable, create a field for the
-- actual value.
if Actual /= Null_Iir