aboutsummaryrefslogtreecommitdiffstats
path: root/src/synth/synth-vhdl_decls.adb
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2022-09-18 08:46:04 +0200
committerTristan Gingold <tgingold@free.fr>2022-09-18 08:46:04 +0200
commit712c08710de22ecbcbf42527ef516160591a1000 (patch)
treef4c5c93ffe7f5bb245210877e3601591d375da72 /src/synth/synth-vhdl_decls.adb
parentb3b31cc9b74b3f1bc07b15ada32ba2925eb490df (diff)
downloadghdl-712c08710de22ecbcbf42527ef516160591a1000.tar.gz
ghdl-712c08710de22ecbcbf42527ef516160591a1000.tar.bz2
ghdl-712c08710de22ecbcbf42527ef516160591a1000.zip
synth: fix assert failure on attribute specification
Diffstat (limited to 'src/synth/synth-vhdl_decls.adb')
-rw-r--r--src/synth/synth-vhdl_decls.adb6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/synth/synth-vhdl_decls.adb b/src/synth/synth-vhdl_decls.adb
index ca1414c84..7bccf96cf 100644
--- a/src/synth/synth-vhdl_decls.adb
+++ b/src/synth/synth-vhdl_decls.adb
@@ -271,10 +271,12 @@ package body Synth.Vhdl_Decls is
is
Attr_Decl : constant Node :=
Get_Named_Entity (Get_Attribute_Designator (Spec));
+ Marker : Mark_Type;
Value : Node;
Val : Valtyp;
Val_Type : Type_Acc;
begin
+ Mark_Expr_Pool (Marker);
Val_Type := Get_Subtype_Object (Syn_Inst, Get_Type (Attr_Decl));
Value := Get_Attribute_Value_Spec_Chain (Spec);
while Value /= Null_Iir loop
@@ -295,8 +297,10 @@ package body Synth.Vhdl_Decls is
--
-- 4. Each new attribute instance is assigned the value of
-- the expression.
+ Val := Unshare (Val, Instance_Pool);
Create_Object (Syn_Inst, Value, Val);
- -- Unshare (Val, Instance_Pool);
+
+ Release_Expr_Pool (Marker);
Value := Get_Spec_Chain (Value);
end loop;