summaryrefslogtreecommitdiff
path: root/gcc/ada/exp_ch5.adb
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/ada/exp_ch5.adb')
-rw-r--r--gcc/ada/exp_ch5.adb2
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/ada/exp_ch5.adb b/gcc/ada/exp_ch5.adb
index 75aa2a5ffa2..8d487727009 100644
--- a/gcc/ada/exp_ch5.adb
+++ b/gcc/ada/exp_ch5.adb
@@ -3466,8 +3466,8 @@ package body Exp_Ch5 is
-- remain there.
pragma Assert (First_Entity (Scope (Loop_Id)) = Loop_Id);
-
Set_First_Entity (Scope (Loop_Id), Next_Entity (Loop_Id));
+
if Last_Entity (Scope (Loop_Id)) = Loop_Id then
Set_Last_Entity (Scope (Loop_Id), Empty);
end if;