From 682cd848b5cd28c96b15b9b0cca70f6192a4c9dc Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Fri, 16 Jan 2015 22:05:29 +0100 Subject: disp_tree: add Max_Depth to limit recursion. --- src/vhdl/disp_tree.adb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/vhdl/disp_tree.adb b/src/vhdl/disp_tree.adb index 70731e3ae..21c9d34ab 100644 --- a/src/vhdl/disp_tree.adb +++ b/src/vhdl/disp_tree.adb @@ -33,6 +33,11 @@ package body Disp_Tree is -- function Is_Anonymous_Type_Definition (Def : Iir) return Boolean -- renames Iirs_Utils.Is_Anonymous_Type_Definition; + -- Max depth for Disp_Iir. Can be modified from a debugger. + pragma Warnings (Off); + Max_Depth : Natural := 10; + pragma Warnings (On); + procedure Disp_Iir (N : Iir; Indent : Natural := 1; Flat : Boolean := False); @@ -366,7 +371,7 @@ package body Disp_Tree is Put_Line (Image_Location_Type (Get_Location (N))); -- Protect against infinite recursions. - if Indent > 20 then + if Indent > Max_Depth then Put_Indent (Indent); Put_Line ("..."); return; -- cgit v1.2.3