comp.lang.ada
 help / color / mirror / Atom feed
From: "Björn Persson" <spam-away@nowhere.nil>
Subject: A bug in Gnat, or in my code?
Date: Thu, 11 Mar 2004 03:18:14 GMT
Date: 2004-03-11T03:18:14+00:00	[thread overview]
Message-ID: <WTQ3c.85738$dP1.242094@newsc.telia.net> (raw)

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?

-- 
Björn Persson

jor ers @sv ge.
b n_p son eri nu




             reply	other threads:[~2004-03-11  3:18 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-03-11  3:18 Björn Persson [this message]
2004-03-11  7:47 ` A bug in Gnat, or in my code? Preben Randhol
2004-03-11 12:48   ` Georg Bauhaus
2004-03-11 13:59     ` Björn Persson
2004-03-12 16:21       ` Florian Villoing
2004-03-12 23:01         ` Björn Persson
2004-03-11 14:29   ` Björn Persson
2004-03-11 14:59     ` Preben Randhol
2004-03-11 17:08       ` Björn Persson
2004-03-11 17:14         ` Preben Randhol
2004-03-11 18:15           ` Björn Persson
2004-03-11 15:08     ` Preben Randhol
2004-03-12  2:59 ` Björn Persson
2004-03-12  5:25   ` Per Sandberg
2004-03-12 23:01     ` Björn Persson
2004-03-12 11:11   ` Manuel Collado
2004-03-12 23:01     ` Björn Persson
replies disabled

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