From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on ip-172-31-65-14.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-1.9 required=3.0 tests=BAYES_00,T_SCC_BODY_TEXT_LINE, XPRIO autolearn=ham autolearn_force=no version=3.4.6 Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: strange cursor in nested containers Date: Sat, 22 Apr 2023 04:33:37 -0500 Organization: A noiseless patient Spider Message-ID: References: <6aa39f27-62ca-4486-9fc7-1c713da5b098n@googlegroups.com> Injection-Date: Sat, 22 Apr 2023 09:33:38 -0000 (UTC) Injection-Info: dont-email.me; posting-host="ad3be9722f67937aaedae639877f02d3"; logging-data="3393291"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18PaYahm4MSuaHQsB2TUhtjvUEtFP3F5j8=" Cancel-Lock: sha1:jd9nnSwcBndjfYDzCbSAXpp/Zwk= X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5931 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.7246 X-RFC2646: Format=Flowed; Original X-Priority: 3 Xref: news.eternal-september.org comp.lang.ada:65126 List-Id: I agree. If you used a debugging container that checked for dangling cursors, you probably would have gotten an exception from any use of the cursor to the dead copy. Not sure that would have been any clearer as to the cause, but it would be a suggestion. (Not sure if GNAT still has debugging containers, they did at one point, but a lot of work has been done on them since.) Randy. "Mario Blunk" wrote in message news:ed311a62-41ba-493e-a4cc-481402a1cc6bn@googlegroups.com... Thanks for your replies. Now it is becoming clear to me: 1. The statement net : type_net renames element (n) gives a copy of element (n). 2. After the assignment to "result" (line 55), "result" points to an element inside the local copy "net". 3. Once "net" is overwritten in the next call of query_net, "result" still refers to a "net" that does not exist anymore. Likewise, once procedure query_net is left, "result" still points to a list that does not exist anymore. Thatswhy I get garbage in line 68 and 77. Correct ?