From ee8689bda870df92d6d18066764fc8d319b1380b Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Fri, 26 Oct 2018 19:14:28 +0200 Subject: ortho_debug: fix disp for empty loop. --- src/ortho/debug/ortho_debug-disp.adb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/ortho/debug/ortho_debug-disp.adb b/src/ortho/debug/ortho_debug-disp.adb index a45bceca9..e2e5793f9 100644 --- a/src/ortho/debug/ortho_debug-disp.adb +++ b/src/ortho/debug/ortho_debug-disp.adb @@ -1108,7 +1108,10 @@ package body Ortho_Debug.Disp is Disp_Loop_Name (Stmt); Put_Line (":"); Add_Tab; - Disp_Snode (Stmt.Next, Stmt.Loop_Last); + if Stmt.Loop_Last /= Stmt then + -- Only if the loop is not empty. + Disp_Snode (Stmt.Next, Stmt.Loop_Last); + end if; Stmt := Stmt.Loop_Last; Rem_Tab; Put_Keyword ("end"); -- cgit v1.2.3