Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!swrinde!cs.utexas.edu!rice!uw-beaver!mit-eddie!bloom-beacon!eru!hagbard!sunic!uts!unierik From: unierik@uts.uni-c.dk (Erik Bertelsen) Newsgroups: comp.sys.mac.programmer Subject: Re: Unsafe use of an object field as a var or > 4 byte parameter Message-ID: Date: 20 Mar 91 20:31:11 GMT References: <4749@syma.sussex.ac.uk> Sender: unierik@uts.uni-c.dk (Erik Bertelsen) Followup-To: comp.sys.mac.programmer Organization: UNI-C Lines: 12 In-Reply-To: paulr@syma.sussex.ac.uk's message of 19 Mar 91 14:09:17 GMT When calling a procedure with a non-VAR parameter larger than 4 bytes, the address of the value is pushed on the stack and the entry code within the procedure makes a copy of the parameter when the procedure is called. This is the problem if the procedure call causes a segment load which relocates the object whose field is passed as a parameter. {$push}{$h-} doit {$pop} is safe when the called procedure is in the same segment as the caller or in a resident segment. Regards Erik Bertelsen UNI-C, The Danish Computing Centre for Research and Education.