comp.lang.ada
 help / color / mirror / Atom feed
* A bug in Gnat, or in my code?
@ 2004-03-11  3:18 Björn Persson
  2004-03-11  7:47 ` Preben Randhol
  2004-03-12  2:59 ` Björn Persson
  0 siblings, 2 replies; 17+ messages in thread
From: Björn Persson @ 2004-03-11  3:18 UTC (permalink / 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




^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2004-03-12 23:01 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-03-11  3:18 A bug in Gnat, or in my code? Björn Persson
2004-03-11  7:47 ` 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

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