From patchwork Mon Aug 1 09:16:02 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnaud Charlet X-Patchwork-Id: 107697 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id 16FB4B6F9F for ; Mon, 1 Aug 2011 19:16:29 +1000 (EST) Received: (qmail 31254 invoked by alias); 1 Aug 2011 09:16:27 -0000 Received: (qmail 31241 invoked by uid 22791); 1 Aug 2011 09:16:26 -0000 X-SWARE-Spam-Status: No, hits=-2.1 required=5.0 tests=AWL, BAYES_00, RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mel.act-europe.fr (HELO mel.act-europe.fr) (194.98.77.210) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 01 Aug 2011 09:16:12 +0000 Received: from localhost (localhost [127.0.0.1]) by filtered-smtp.eu.adacore.com (Postfix) with ESMTP id 2D897CB01E5; Mon, 1 Aug 2011 11:16:11 +0200 (CEST) Received: from mel.act-europe.fr ([127.0.0.1]) by localhost (smtp.eu.adacore.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id YFrMWkzAtaEy; Mon, 1 Aug 2011 11:16:00 +0200 (CEST) Received: from saumur.act-europe.fr (saumur.act-europe.fr [10.10.0.183]) by mel.act-europe.fr (Postfix) with ESMTP id 0757BCB0245; Mon, 1 Aug 2011 11:16:00 +0200 (CEST) Received: by saumur.act-europe.fr (Postfix, from userid 525) id E1B7D245242; Mon, 1 Aug 2011 11:16:02 +0200 (CEST) Date: Mon, 1 Aug 2011 11:16:02 +0200 From: Arnaud Charlet To: gcc-patches@gcc.gnu.org Cc: Matthew Heaney Subject: [Ada] Incorrect assignment when deleting node Message-ID: <20110801091602.GA1953@adacore.com> Mime-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.9i X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org 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 * a-rbtgbo.adb (Delete_Node_Sans_Free): Fixed assignment to left child of node. 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);