From: Mehdi Saada <00120260a@gmail.com>
Subject: CONSTRAINT ERROR? access check failed
Date: Wed, 28 Feb 2018 16:27:05 -0800 (PST)
Date: 2018-02-28T16:27:05-08:00 [thread overview]
Message-ID: <39fc7bbf-77e8-4342-9af7-68cb5e9acb8a@googlegroups.com> (raw)
I got
raised CONSTRAINT_ERROR : ledit.adb:34 access check failed
for the "while" line before. I found an old post about this problem, allocated composite object being constrained even when being of an unconstrained subtype... but I hardly understood anything. It's clearly out of my league, and it's not like I don't LOVE to dig and learn, believe me:
procedure INSERT_OR_REPLACE
(NUMBER : in LINE_NUMBER; LINE : in STRING) is
TEMP : access LINK := HEAD;
begin
while TEMP.NEXT /= null and TEMP.NEXT.NUM < NUMBER loop
TEMP := TEMP.NEXT;
end loop;
TEMP.next := new LINK'
(Num => NUMBER,
Length => LINE'Length,
NEXT => (if TEMP.NEXT.NUM = NUMBER then TEMP.NEXT.NEXT else TEMP.NEXT),
Line => LINE);
end;
So, if someone could provide me a quick solution that don't change much my current code (I already have trouble understanding it, changing the data structure would crush me)... Here's the LINK type and HEAD constant:
type Link (Num : LINE_NUMBER := 0; Length : NATURAL := 0) is
record
NEXT : access LINK := null;
Line : String (1 .. Length) := (1..Length => ' ');
end record;
HEAD : constant access Link := new LINK '(0,0,null,"");
Instead of a snippet, you could advise me to put assertions here and there to help me see the solution by myself, eventually. But I definitely won't eat the whole damn allocator AARM section...
Mehdi
next reply other threads:[~2018-03-01 0:27 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-03-01 0:27 Mehdi Saada [this message]
2018-03-01 8:07 ` CONSTRAINT ERROR? access check failed Niklas Holsti
2018-03-01 12:44 ` Mehdi Saada
2018-03-01 13:45 ` Björn Lundin
2018-03-01 14:06 ` Mehdi Saada
2018-03-01 14:31 ` Mehdi Saada
2018-03-01 14:38 ` Mehdi Saada
2018-03-01 15:53 ` Anh Vo
2018-03-01 17:24 ` Mehdi Saada
2018-03-01 18:34 ` Anh Vo
2018-03-01 17:26 ` Simon Wright
2018-03-01 17:47 ` Mehdi Saada
2018-03-01 17:56 ` Jeffrey R. Carter
2018-03-01 8:30 ` Simon Wright
2018-03-01 12:14 ` Mehdi Saada
2018-03-01 13:27 ` Simon Wright
2018-03-01 13:44 ` Mehdi Saada
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox