doesn’t matter, by the time the code reaches the branch to address, address is 
a value that will work.

> -----Original Message-----
> From: IBM Mainframe Discussion List <[email protected]> On
> Behalf Of Paul Gilmartin
> Sent: Sunday, February 07, 2021 2:29 PM
> To: [email protected]
> Subject: Re: LINK vs LOAD/CALL
> 
> On Sun, 7 Feb 2021 21:32:36 +0200, Binyamin Dissen wrote:
> 
> >On Sun, 7 Feb 2021 19:04:16 +0000 "Gibney, Dave"  wrote:
> >    ...
> >:>Classic "bad" code
> >:>IF address = 0
> >:>    Determine and store address
> >:>End-if
> >:>Branch to address
> >
> Beware TOCTTOU!
> 
> >I guess you can add the case where the value calculated will always calculate
> >to the exact same value, such as an address in the module or the value of a
> >name/token, where if it is not set, check if it exists and restore it.
> >
> The test must be performed on a value loaded in temporary storage
> or a register, and that value used if non-zero; else loop back and
> try again.  (Once may not be enough.  But limit the number of retries.)
> 
> -- gil
> 
> ----------------------------------------------------------------------
> For IBM-MAIN subscribe / signoff / archive access instructions,
> send email to [email protected] with the message: INFO IBM-MAIN

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN

Reply via email to