comp.lang.ada
 help / color / mirror / Atom feed
From: Warren <ve3wwg@gmail.com>
Subject: Re: Generic Embedded List Nodes
Date: Fri, 1 Jul 2016 09:28:13 -0700 (PDT)
Date: 2016-07-01T09:28:13-07:00	[thread overview]
Message-ID: <0a7b4865-2aa2-4c50-82e7-350c7401e537@googlegroups.com> (raw)
In-Reply-To: <82fe84fe-4ff1-46fa-9bce-737beeb3d102@googlegroups.com>

On Friday, 1 July 2016 09:49:19 UTC-4, Warren  wrote:
> On Saturday, 25 June 2016 01:50:41 UTC-4, Niklas Holsti  wrote:
> > On 16-06-24 15:49 , Warren wrote:
> ..
> >     procedure Insert_At_Head (
> >        List : access List_T;
> >        Node : in     Emb_Node_Ref_T)
> >     is
> >     begin
> >        if List.Next /= null then
> >           List.Next.Prev := Node;
> >        end if;
> >        Node.Next := List.Next;
> >        List.Next := Node;
> >        Node.Prev := Emb_Node_Ref_T (List);
> >     end Insert_At_Head;
> 
> Niklas: I finally got a few minutes to revisit this and worked up a full example based upon yours.  I fear that the design is still flawed. I'm using a slightly modified version of this, but basically, the problem occurs at the line:
> 
> >        Node.Prev := Emb_Node_Ref_T (List);
> 
> with the exception:
> 
> raised PROGRAM_ERROR : niklas.adb:14 accessibility check failed
> 
> My example code is located on github here:  https://github.com/ve3wwg/ada_embedded_list
> 
> Maybe there is pilot error somewhere. I'm using: GNATMAKE 6.1.0.
> 
> Warren

Sorry, nevermind. When I allocate the list with:

    List1:   aliased access List_T := new List_T;

it is fine.  I suppose that the runtime was worried about dangling pointers when it was originally allocated on the stack frame in:

    List1:   aliased List_T;

Warren


  reply	other threads:[~2016-07-01 16:28 UTC|newest]

Thread overview: 52+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-18 22:52 Generic Embedded List Nodes Warren
2016-06-18 23:40 ` Jeffrey R. Carter
2016-06-19  2:15   ` Warren
2016-06-19  3:04     ` Jeffrey R. Carter
2016-06-19  2:14 ` Jeremiah
2016-06-19  2:21   ` Warren
2016-06-19  2:50     ` Warren
2016-06-19  4:45       ` Simon Wright
2016-06-19 18:27         ` Warren
2016-06-19 19:04           ` Dmitry A. Kazakov
2016-06-19 20:13             ` Warren
2016-06-19 20:35               ` Dmitry A. Kazakov
2016-06-20  2:42                 ` Warren
2016-06-20  7:25                   ` Dmitry A. Kazakov
2016-06-20 12:26                     ` Warren
2016-06-20 19:33                       ` Niklas Holsti
2016-06-21  2:20                         ` Warren
2016-06-21  5:52                           ` Niklas Holsti
2016-06-21  7:15                             ` Dmitry A. Kazakov
2016-06-21 18:54                               ` Niklas Holsti
2016-06-21 19:54                                 ` Dmitry A. Kazakov
2016-06-21 10:31                             ` Warren
2016-06-21 17:13                               ` Jeffrey R. Carter
2016-06-21 18:56                                 ` Niklas Holsti
2016-06-21 20:13                                   ` Warren
2016-06-21 21:38                               ` Niklas Holsti
2016-06-23  2:12                                 ` Warren
2016-06-23  8:19                                   ` Niklas Holsti
2016-06-23 12:37                                     ` Warren
2016-06-23 15:36                                       ` Niklas Holsti
2016-06-24  1:55                                         ` Warren
2016-06-24 12:49                                         ` Warren
2016-06-25  5:50                                           ` Niklas Holsti
2016-06-26  1:36                                             ` Warren
2016-07-01 13:49                                             ` Warren
2016-07-01 16:28                                               ` Warren [this message]
2016-06-24 20:25                                         ` Warren
2016-06-22 13:01                               ` G.B.
2016-06-23  2:30                                 ` Warren
2016-06-20  6:08 ` Niklas Holsti
2016-06-20 12:20   ` Warren
2016-06-20 19:47 ` Shark8
2016-06-21  2:28   ` Warren
2016-06-21  7:21     ` Dmitry A. Kazakov
2016-06-21 10:32       ` Warren
2016-06-21 11:56         ` Dmitry A. Kazakov
2016-06-21 13:39           ` Warren
2016-06-21 14:04             ` Dmitry A. Kazakov
2016-06-23  0:37     ` Randy Brukardt
2016-06-23  2:25       ` Warren
2016-07-01 19:50 ` brbarkstrom
2016-07-02  1:55   ` Warren
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox