Path: utzoo!utgpu!water!watmath!clyde!att!pacbell!ames!amdcad!sun!pitstop!sundc!seismo!uunet!portal!cup.portal.com!Michael_mkahl_Kahl
From: Michael_mkahl_Kahl@cup.portal.com
Newsgroups: comp.sys.mac.programmer
Subject: Re: A Tale of Two Bugs
Message-ID: <6875@cup.portal.com>
Date: 26 Jun 88 00:07:53 GMT
References: <4421@dasys1.UUCP> <3384@pasteur.Berkeley.Edu>
Organization: The Portal System (TM)
Lines: 24
XPortal-User-Id: 1.1001.4169

LSC's use of ToolScratch is a holdover from the days before it had
an inline assembler.  The address of the code resource can now be
accessed directly from register A0.  I have removed the reference
to ToolScratch in version 3.0 (shipping imminently).

That said, however, I would like to defend the use of ToolScratch
by earlier versions of LSC.  It is perfectly legitimate!  There are
two issues:  (1) Will the value LSC places in ToolScratch still be
valid by the time it is retrieved?  and (2) Is LSC smashing someone
else's (e.g. the Menu Manager's) legitimate use of ToolScratch?

(1) The user is expected to retrieve the value in ToolScratch
first thing as the code resource begins to execute; there have been
no Toolbox calls since the value was set, so it must still be valid.

(2) ToolScratch is not guaranteed to be preserved across calls to
the Toolbox.  Is the Menu Manager right to assume that the
MDEF makes no Toolbox calls?  Of course not.  Therefore, the MDEF
is under no obligation not to step on ToolScratch.

Anyway, this is all moot with 3.0, but I though I'd try to set the
record straight.

-- Michael Kahl, Symantec