From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, T_FILL_THIS_FORM_SHORT autolearn=unavailable autolearn_force=no version=3.4.4 X-Received: by 10.50.73.37 with SMTP id i5mr2882605igv.2.1382250545872; Sat, 19 Oct 2013 23:29:05 -0700 (PDT) X-Received: by 10.182.246.133 with SMTP id xw5mr97915obc.14.1382250545830; Sat, 19 Oct 2013 23:29:05 -0700 (PDT) Path: border1.nntp.ams3.giganews.com!border1.nntp.ams2.giganews.com!border3.nntp.ams.giganews.com!border1.nntp.ams.giganews.com!nntp.giganews.com!xlned.com!feeder3.xlned.com!news.glorb.com!o2no15179554qas.0!news-out.google.com!9ni58915qaf.0!nntp.google.com!i2no22722261qav.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Sat, 19 Oct 2013 23:29:05 -0700 (PDT) In-Reply-To: <28e86e6c-f2e1-4cca-abce-cd6f73447f4d@googlegroups.com> Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=97.123.228.141; posting-account=lJ3JNwoAAAAQfH3VV9vttJLkThaxtTfC NNTP-Posting-Host: 97.123.228.141 References: <9bc1be39-4377-4df5-8686-786babc756d1@googlegroups.com> <12afac91-f0f3-4f89-ac0f-a61aaf7b8d4b@googlegroups.com> <0bb058fa-df1b-4092-a6f9-47d12a5f5791@googlegroups.com> <28e86e6c-f2e1-4cca-abce-cd6f73447f4d@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <2f2f46da-e6c2-4e0c-a5d2-3859975b67c9@googlegroups.com> Subject: Re: Possible GNAT problem with aliased parameters. From: Shark8 Injection-Date: Sun, 20 Oct 2013 06:29:05 +0000 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Original-Bytes: 3274 Xref: number.nntp.dca.giganews.com comp.lang.ada:183676 Date: 2013-10-19T23:29:05-07:00 List-Id: On Saturday, October 19, 2013 3:17:17 PM UTC-6, Shark8 wrote: >=20 >=20 My solution was to use renames on the parameters and then allocate new memo= ry for the copies. It's not great, but there's no accessibility errors... I= 'm not sure if I ought to use Unchecked_Deallocate and/or Finalize here tho= ugh. (Also, pools might be nice to ensure that things really do get cleaned= up upon scope-exit.) -- In the Spec: ------------------------------------ Function Create ( Location_Name : String; -- Unique ID-string North, South, East, West, Up, Down : Story_Location'Class:=3D Nowhere ) return Story_Location; -- In the Body: ------------------------------------ Function Create ( Location_Name : String; North, South, East, West, Up, Down : Maze'Class:=3D None ) return Maze is =09 N : Maze renames Maze(North); S : Maze renames Maze(South); E : Maze renames Maze(East); W : Maze renames Maze(West); U : Maze renames Maze(Up); D : Maze renames Maze(Down); =09 Subtype Node is Maze( Length_N =3D> Location_Name'Length ); begin Return Result : Node do Result.Name :=3D Location_Name; Result.Exits:=3D ( Maze.North =3D> (if N =3D Nowhere then null else New Maze'( N )), Maze.South =3D> (if S =3D Nowhere then null else New Maze'( S )), Maze.East =3D> (if E =3D Nowhere then null else New Maze'( E )), Maze.West =3D> (if W =3D Nowhere then null else New Maze'( W )), Maze.Up =3D>=20 (if U =3D Nowhere then null else New Maze'( U )), Maze.Down =3D> (if D =3D Nowhere then null else New Maze'( D )), others =3D> null ); End return; end;