diff options
Diffstat (limited to 'gcc/ada/a-cuprqu.adb')
-rw-r--r-- | gcc/ada/a-cuprqu.adb | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/gcc/ada/a-cuprqu.adb b/gcc/ada/a-cuprqu.adb index fb02f09..7502aa9 100644 --- a/gcc/ada/a-cuprqu.adb +++ b/gcc/ada/a-cuprqu.adb @@ -187,10 +187,17 @@ package body Ada.Containers.Unbounded_Priority_Queues is Prev.Next.Prev := Node; Prev.Next := Node; - if List.Length = 0 then + if Prev = H then + + -- Make sure Next_Unequal of the Header always points to the first + -- "real" node. Here, we've inserted a new first "real" node, so + -- must update. + List.Header.Next_Unequal := Node; end if; + pragma Assert (List.Header.Next_Unequal = List.Header.Next); + List.Length := List.Length + 1; if List.Length > List.Max_Length then |