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=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,4fbd260da735f6f4 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news4.google.com!proxad.net!proxad.net!newsfeed.arcor.de!newsspool2.arcor-online.net!news.arcor.de.POSTED!not-for-mail From: "Dmitry A. Kazakov" Subject: Re: Copying string slices before calling subroutines? Newsgroups: comp.lang.ada User-Agent: 40tude_Dialog/2.0.15.1 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Reply-To: mailbox@dmitry-kazakov.de Organization: cbb software GmbH References: <0hj5339mjmond132qhbn2o01unurs61lbj@4ax.com> <1178091967.392381.282510@o5g2000hsb.googlegroups.com> <5dv3wh6scrh1.2986pbvdw8y2$.dlg@40tude.net> Date: Fri, 4 May 2007 12:14:52 +0200 Message-ID: <4oppvmc6anir.g0mz9mrahmdo.dlg@40tude.net> NNTP-Posting-Date: 04 May 2007 12:14:52 CEST NNTP-Posting-Host: 00c0b4b4.newsspool4.arcor-online.net X-Trace: DXC=Z89BY>eX;47kUFX=Y?aLP;4IUK_6=k7>>=I0DNcfSJ;bb[5FCTGGVUmh?4LK[5LiR>kg2Gj8BCXVT:;6 X-Complaints-To: usenet-abuse@arcor.de Xref: g2news1.google.com comp.lang.ada:15507 Date: 2007-05-04T12:14:52+02:00 List-Id: On Fri, 04 May 2007 11:44:14 +0200, Jacob Sparre Andersen wrote: > Jacob Sparre Andersen wrote: >> Dmitry A. Kazakov wrote: >>> On Fri, 04 May 2007 08:53:59 +0200, Jacob Sparre Andersen wrote: > >>>> for Lines in 1 .. 10 loop >>>> Last := Index (Source => Text (Text'First .. Last - 1), >>> >>> Did you check if GNAT did not copy the string slice before calling to >>> Index? >> >> No. Do you have any suggestion for a way to check it. The >> reference manual (section 6.2) seems to indicate that it is up to >> the compiler to decide. > > I have found a strong indication that GNAT copies the whole string > slice onto the stack before calling Index: So, Index was innocent. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de