[Ada] Delete: set Position to No_Element
authorBob Duff <duff@adacore.com>
Thu, 10 Sep 2020 15:49:50 +0000 (11:49 -0400)
committerPierre-Marie de Rodat <derodat@adacore.com>
Mon, 26 Oct 2020 08:58:57 +0000 (04:58 -0400)
gcc/ada/

* libgnat/a-cihama.adb, libgnat/a-cohama.adb,
libgnat/a-cohase.adb (Delete): Set Position.Position, and
assert.

gcc/ada/libgnat/a-cihama.adb
gcc/ada/libgnat/a-cohama.adb
gcc/ada/libgnat/a-cohase.adb

index 64f662f..7a490d5 100644 (file)
@@ -349,6 +349,8 @@ is
 
       Free (Position.Node);
       Position.Container := null;
+      Position.Position := No_Element.Position;
+      pragma Assert (Position = No_Element);
    end Delete;
 
    -------------
index 1475330..9c4e51a 100644 (file)
@@ -336,6 +336,8 @@ is
 
       Free (Position.Node);
       Position.Container := null;
+      Position.Position := No_Element.Position;
+      pragma Assert (Position = No_Element);
    end Delete;
 
    -------------
index 63e44e1..0131f73 100644 (file)
@@ -319,6 +319,8 @@ is
 
       Free (Position.Node);
       Position.Container := null;
+      Position.Position := No_Element.Position;
+      pragma Assert (Position = No_Element);
    end Delete;
 
    ----------------