comp.lang.ada
 help / color / mirror / Atom feed
From: Adam Beneschan <adambeneschan@aol.com>
Subject: Re: Access check failed without using the word "access" in source
Date: Thu, 22 Aug 2013 08:40:17 -0700 (PDT)
Date: 2013-08-22T08:40:17-07:00	[thread overview]
Message-ID: <73a61aed-a50a-4c80-92db-917caace23b7@googlegroups.com> (raw)
In-Reply-To: <slrnl1c7ro.1lme.lithiumcat@sigil.instinctive.eu>

On Thursday, August 22, 2013 7:26:36 AM UTC-7, Natasha Kerensikova wrote:

> So from what I understand here, P.C.Process doesn't return a P.I'Class
> object (as in the actual source) but rather an access (or a pointer, not
> sure about the correct vocabulary at this level), which a reasonable
> implementation.

Sure, it would be common for an implementation to return a pointer when the return type is something whose size isn't determinable beforehand (such as an unconstrained array or I'Class).  However, since implicit pointers like this aren't access objects (as defined by Ada), they shouldn't be causing Constraint_Errors.

It's definitely possible for an *accessibility* check to fail even when there are no access objects in the program (that can happen when a tagged type inside a function is derived from a type outside the function, and the function tries to return an object of the inside type, which fails because the outside world isn't allowed to see any objects of the inside type).  But accessibility check failures raise Program_Error.  It definitely looks like something is being checked for null.  So I'd say this is a definite compiler bug.

For what it's worth, I don't think you need the Create to reproduce the problem; if you remove it, and remove the Self parameter from one of the Process functions, it still fails.  But it doesn't fail if the main program calls that Process directly instead of the one with the String parameter.

                             -- Adam

      reply	other threads:[~2013-08-22 15:40 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-22 14:26 Access check failed without using the word "access" in source Natasha Kerensikova
2013-08-22 15:40 ` Adam Beneschan [this message]
replies disabled

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