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=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,2308afbbe4ecec0b X-Google-Attributes: gid103376,public From: tmoran@bix.com Subject: Re: Subverting 'Access for Sub-programs Date: 1999/08/03 Message-ID: #1/1 X-Deja-AN: 508449570 References: <37A71EF1.2201@dera.gov.uk> X-Complaints-To: abuse@pacbell.net X-Trace: typhoon-sf.snfc21.pbi.net 933702899 206.170.2.192 (Tue, 03 Aug 1999 10:54:59 PDT) Organization: SBC Internet Services NNTP-Posting-Date: Tue, 03 Aug 1999 10:54:59 PDT Newsgroups: comp.lang.ada Date: 1999-08-03T00:00:00+00:00 List-Id: Remember that Database.Perform is completely within its rights to save away the Action parameter and call Action later. It might save it in a variable, or, more subtly, hand it to a task which will use it after Action no longer exists. A jump into random junk is not a very nice way for a program to crash. To avoid the problem, how about: package Dont_Disappear is procedure Print_If_Even( I : in Integer ); end Dont_Disappear; with Text_IO; package body Dont_Disappear is procedure Print_If_Even( I : in Integer ) is begin if I rem 2 = 0 then Text_IO.Put_Line( Integer'Image( I ) ); end if; end Print_If_Even; end Dont_Disappear; with Database, Dont_Disappear; procedure Main is begin Database.Perform( Action => Dont_Disappear.Print_If_Even'Access ); end Main;