public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [Ada] Incorrect assignment when deleting node
@ 2011-08-01  9:16 Arnaud Charlet
  0 siblings, 0 replies; only message in thread
From: Arnaud Charlet @ 2011-08-01  9:16 UTC (permalink / raw)
  To: gcc-patches; +Cc: Matthew Heaney

[-- Attachment #1: Type: text/plain, Size: 382 bytes --]

When a node was being removed from the tree, the node itself was
being assigned to the child of its parent, which was incorrect.
The correct assignment value is the left child of the deleted node.

Tested on x86_64-pc-linux-gnu, committed on trunk

2011-08-01  Matthew Heaney  <heaney@adacore.com>

	* a-rbtgbo.adb (Delete_Node_Sans_Free): Fixed assignment to left child
	of node.


[-- Attachment #2: difs --]
[-- Type: text/plain, Size: 467 bytes --]

Index: a-rbtgbo.adb
===================================================================
--- a-rbtgbo.adb	(revision 176998)
+++ a-rbtgbo.adb	(working copy)
@@ -330,7 +330,7 @@
                   Set_Right (N (Parent (N (Z))), Y);
                end if;
 
-               Set_Left (N (Y), Z);
+               Set_Left (N (Y), Left (N (Z)));
                Set_Parent (N (Left (N (Y))), Y);
                Set_Right (N (Y), Z);
                Set_Parent (N (Z), Y);

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2011-08-01  9:16 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-08-01  9:16 [Ada] Incorrect assignment when deleting node Arnaud Charlet

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).