From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,8a6e6d9458ae6ddc,start X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!postnews1.google.com!not-for-mail From: wojtek@power.com.pl (Wojtek Narczynski) Newsgroups: comp.lang.ada Subject: Is this a bug? Date: 22 Sep 2004 17:52:50 -0700 Organization: http://groups.google.com Message-ID: <5ad0dd8a.0409221652.6a69b336@posting.google.com> NNTP-Posting-Host: 83.27.72.226 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: posting.google.com 1095900770 27802 127.0.0.1 (23 Sep 2004 00:52:50 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Thu, 23 Sep 2004 00:52:50 +0000 (UTC) Xref: g2news1.google.com comp.lang.ada:3979 Date: 2004-09-22T17:52:50-07:00 List-Id: Hello, GNAT 3.4.2 linux. If I uncomment the Current declaration, and replace all occurrences of Current_Hook.all with it, the code does not work anymore. Complete runnable testcase available upon request. Is this a bug? Regards, Wojtek procedure Put_Last (Queue : in out Queue_Type; Bucket : out Bucket_Access; Element : in Queue_Element_Access; Priority : Integer) is Current_Hook : Bucket_Access_Access := Queue.Anchor'Unchecked_Access; -- Current : Bucket_Access renames Current_Hook.all; -- XXX Uncommented and used - breaks the code begin loop if Current_Hook.all = null then -- Reached end of list, append bucket Current_Hook.all := new Bucket_Type; Current_Hook.all.Priority := Priority; exit; elsif Current_Hook.all.Priority > Priority then -- Traverse to the next bucket Current_Hook := Current_Hook.all.Down'Unchecked_Access; elsif Current_Hook.all.Priority = Priority then -- Found bucket with desired pririty exit; elsif Current_Hook.all.Priority < Priority then -- Insert a bucket before current declare Bucket_New : Bucket_Access := new Bucket_Type; begin Bucket_New.Down := Current_Hook.all; Current_Hook.all := Bucket_New; Current_Hook.all.Priority := Priority; exit; end; end if; end loop; -- Here we are at bucket with correct priority Bucket := Current_Hook.all; Put_Last (Bucket.all, Element); end Put_Last;