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=-2.9 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI autolearn=unavailable autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII X-Google-Thread: 103376,23d2475711dc99b8 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2004-03-10 23:50:09 PST Path: archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!nnx.oleane.net!oleane!freenix!enst.fr!melchior!cuivre.fr.eu.org!melchior.frmug.org!not-for-mail From: Preben Randhol Newsgroups: comp.lang.ada Subject: Re: A bug in Gnat, or in my code? Date: Thu, 11 Mar 2004 08:47:40 +0100 Organization: PVV Sender: Preben Randhol Message-ID: References: NNTP-Posting-Host: lovelace.ada-france.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Trace: melchior.cuivre.fr.eu.org 1078991278 6433 212.85.156.195 (11 Mar 2004 07:47:58 GMT) X-Complaints-To: usenet@melchior.cuivre.fr.eu.org NNTP-Posting-Date: Thu, 11 Mar 2004 07:47:58 +0000 (UTC) To: comp.lang.ada@ada-france.org Return-Path: Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.5.1+cvs20040105i X-Virus-Scanned: by amavisd-new-20030616-p7 (Debian) at ada-france.org X-BeenThere: comp.lang.ada@ada-france.org X-Mailman-Version: 2.1.4 Precedence: list List-Id: "Gateway to the comp.lang.ada Usenet newsgroup" List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Xref: archiver1.google.com comp.lang.ada:6226 Date: 2004-03-11T08:47:40+01:00 Bj�rn Persson wrote on 11/03/2004 (08:22) : > This program, when compiled with Gnat 3.3.2 and run on Fedora Core 1, > raises Storage_Error on line 7 (because of a segmentation fault): > > procedure Error is -- 1 > -- 2 > procedure Proc (NullS : String) is -- 3 > type SA is access String; -- 4 > Point : SA := new String (1 .. 0); -- 5 > begin -- 6 > Point.all := NullS; -- 7 > end Proc; -- 8 > -- 9 > S : String := "s"; -- 10 > begin -- 11 > Proc(S(3 .. 1)); -- 12 > end Error; -- 13 > > If I change 3 to 2 on line 12 there is no error. As far as I can see, > (3..1) should be as legal as (2..1). > > Am I right that this is a bug in Gnat? I don't get this behaviour in gnat 3.15p so it is probably a gnat 3.3.2 bug. That said what are you trying to do with the code? It looks wierd to me. -- Preben Randhol -------------- http://www.pvv.org/~randhol/Ada95 -- �For me, Ada95 puts back the joy in programming.�