From: "G.B." <bauhaus@notmyhomepage.invalid>
Subject: Re: Bad cursor, good cursor
Date: Mon, 27 Mar 2017 20:12:07 +0200
Date: 2017-03-27T20:12:07+02:00 [thread overview]
Message-ID: <obbkg6$e7p$1@dont-email.me> (raw)
In-Reply-To: <daa754ff-d2fc-484e-bfe8-e55a2f63ce53@googlegroups.com>
On 27/03/2017 18:56, Marius Amado-Alves wrote:
> Ada 2012 compiled with latest(?) free GNAT (20160515-19)
>
> This breaks with a "bad cursor" error for Subthing_Maps.Element at line 7. But how can that be, if the cursor has just been vetted at line 6 as not No_Element, and there were no changes to the container meanwhile, not even navigation?
>
> 1 C := Thing.Find (Thing_ID);
> 2 if C = Thing_Maps.No_Element then
> 3 Thing.Insert (Thing_ID, Subthing_Maps.Empty_Map, C, Ok);
> 4 end if;
> 5 I := Subthing_Maps.Find (Thing_Maps.Element (C), Subthing_ID);
> 6 if I = Subthing_Maps.No_Element
> 7 or else Subthing_Maps.Element (I) = Preterred then
> 8 Thing.Update_Element (C, Add_Subthing'Access);
> 9 end if;
Are Thing_Maps and Thing different? Thing.Insert involves C,
which is then passed to Thing_Maps.Element.
Just an observation, even though it isn't obviously connected
with I.
Is there overlap in some form or other, of things involved?
next prev parent reply other threads:[~2017-03-27 18:12 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-03-27 16:56 Bad cursor, good cursor Marius Amado-Alves
2017-03-27 18:12 ` G.B. [this message]
2017-03-27 18:35 ` Marius Amado-Alves
2017-03-27 22:26 ` Randy Brukardt
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox