From f2c4cfadb13dd5eef1979069317e5c6ee224c908 Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Fri, 23 Nov 2018 04:28:44 +0100 Subject: Add --max-stack-alloc option, check stack allocation of complex object. Fix #692 --- src/vhdl/translate/translation.adb | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'src/vhdl/translate/translation.adb') diff --git a/src/vhdl/translate/translation.adb b/src/vhdl/translate/translation.adb index 2edeba0be..0999e792e 100644 --- a/src/vhdl/translate/translation.adb +++ b/src/vhdl/translate/translation.adb @@ -15,6 +15,7 @@ -- along with GCC; see the file COPYING. If not, write to the Free -- Software Foundation, 59 Temple Place - Suite 330, Boston, MA -- 02111-1307, USA. +with Interfaces; use Interfaces; with Ortho_Nodes; use Ortho_Nodes; with Ortho_Ident; use Ortho_Ident; with Flags; use Flags; @@ -1079,6 +1080,20 @@ package body Translation is Create_Report_Subprg ("__ghdl_report", Ghdl_Report); end; + -- procedure __ghdl_check_stack_allocation (size : __ghdl_index_type) + Start_Procedure_Decl + (Interfaces, Get_Identifier ("__ghdl_check_stack_allocation"), + O_Storage_External); + New_Interface_Decl (Interfaces, Param, Wki_Val, Ghdl_Index_Type); + Finish_Subprogram_Decl (Interfaces, Ghdl_Check_Stack_Allocation); + + if Flag_Check_Stack_Allocation > 0 then + Check_Stack_Allocation_Threshold := + New_Index_Lit (Unsigned_64 (Flag_Check_Stack_Allocation)); + else + Check_Stack_Allocation_Threshold := O_Cnode_Null; + end if; + -- procedure __ghdl_text_write (file : __ghdl_file_index; -- str : std_string_ptr); Start_Procedure_Decl -- cgit v1.2.3