From 620ddf92b9d72e9dc39e03ea0f6b3b33cf75363f Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Mon, 19 Jun 2017 20:44:22 +0200 Subject: Translate: use create_temp for create_record_type_builder. Fix #370 --- src/vhdl/translate/trans-chap3.adb | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/vhdl/translate/trans-chap3.adb b/src/vhdl/translate/trans-chap3.adb index 4457403ec..b18ca4515 100644 --- a/src/vhdl/translate/trans-chap3.adb +++ b/src/vhdl/translate/trans-chap3.adb @@ -1350,10 +1350,8 @@ package body Trans.Chap3 is and then El_Tinfo.C (Kind).Builder_Need_Func then -- This type needs a builder, call it. - Start_Declare_Stmt; - New_Var_Decl - (Ptr_Var, Get_Identifier ("var_ptr"), - O_Storage_Local, El_Tinfo.Ortho_Ptr_Type (Kind)); + Open_Temp; + Ptr_Var := Create_Temp (El_Tinfo.Ortho_Ptr_Type (Kind)); New_Assign_Stmt (New_Obj (Ptr_Var), @@ -1367,7 +1365,7 @@ package body Trans.Chap3 is Gen_Call_Type_Builder (Dp2M (Ptr_Var, El_Tinfo, Kind), El_Type))); - Finish_Declare_Stmt; + Close_Temp; else if Is_Unbounded_Type (El_Tinfo) then Sub_Bound := Bounds_To_Element_Bounds -- cgit v1.2.3