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.8 required=5.0 tests=BAYES_00,INVALID_DATE autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,8b17657f496d184f X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 1994-10-05 15:31:19 PST Path: bga.com!news.sprintlink.net!howland.reston.ans.net!math.ohio-state.edu!magnus.acs.ohio-state.edu!csn!boulder!news.coop.net!news.den.mmc.com!iplmail.orl.mmc.com!romulus23!dennison From: dennison@romulus23.DAB.GE.COM (Ted Dennison) Newsgroups: comp.lang.ada Subject: Re: Posix.String_List question Date: 5 Oct 1994 16:59:27 GMT Organization: General Electric SCSD, Daytona Beach FL Sender: dennison@romulus23 (Ted Dennison) Distribution: world Message-ID: <36um1f$b65@theopolis.orl.mmc.com> References: NNTP-Posting-Host: romulus23.orl.mmc.com Date: 1994-10-05T16:59:27+00:00 List-Id: In article , stef@heron.cfmu.eurocontrol.be (Stef Van Vlierberghe) writes: |> |> I recently reported a "bug" (Alsys 5.5.2 on HP9000/700), but the actual |> code is so aggressive that I'm not sure who really is to blame. I see a |> choice of the appliction, the vendor, POSIX1003.5 definition, or Ada. |> |> The relevant code is : |> |> BYPASS_COPY_BACK : exception; |> |> procedure TRY_BREAK_IT ( LIST : in out POSIX_STRING_LIST ) is |> begin |> MAKE_EMPTY(LIST); |> raise BYPASS_COPY_BACK; |> -- if LIST is by copy the caller won't see we emptied it |> end; |> (rest of code deleted) |> After quite a while this code gets the heap corrupted. |> |> Evidently the relevant piece of LRM is 6.2(7) : The execution of a |> program is erroneous if its effect depends on which mechanism is selected |> by the implementation. |> Also signifigant: LRM 6.2 (11-12): "For parameters of array and record types, the parameter passing rules have these consequences: o If the execution of a subprogram is abandoned as a result of an exception, the final value of an acutal parameter of such a type can be either its value before the call or a value assigned to the formal parameter during the execution of the subprogram." Therefore this behavior is a bug in your code, NOT in the compiler. To force a call by reference, simply pass TRY_BREAK_IT an object of type "access POSIX_STRING_LIST". T.E.D.