Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!usc!apple!Apple.COM!lsr From: lsr@Apple.COM (Larry Rosenstein) Newsgroups: comp.sys.mac.programmer Subject: Re: How to Argue Technical Points (was Re: Tail patches) Message-ID: <5512@internal.Apple.COM> Date: 30 Nov 89 02:01:44 GMT Sender: usenet@Apple.COM Organization: Objects-R-Us, Apple Computer, Inc. Lines: 37 References:<5432@internal.Apple.COM> <33413@mirror.UUCP> In article <33413@mirror.UUCP> francis@mirror.UUCP (Joe Francis) writes: > However, many articles ago you said that there were numerous subtle > reasons not to tail patch. None of the notes I have read refer to these > other reasons, and I would very much like to hear about ANY of them. Here's one. (CAVEAT: I don't write system software patches, so the following is based on poking around with Macsbug.) On a Mac II there's a come-from patch for GetHandleSize. If you look at the patch, you see that it first tests whether GetHandleSize was called from address $4081885E. If it was, then it calls MaxSizeRsrc instead of GetHandleSize, and returns. (It also handles the case where the handle isn't a resource and returns $26 as the size.) That address happens to be in the Print Manager code. Presumably, there the Print Manager is calling GetHandleSize and it should be calling MaxSizeRsrc. (More likely, there is some subtle bug in the code.) Now, if you patch GetHandleSize, then when GetHandleSize is called your patch executes. If you do a JSR , then the return address as seen by the first patch is never going to be the magic address I mentioned. Therefore when the Print Manager calls GetHandleSize, it will bypass the bug fix and call the GetHandleSize implemented in the ROM. I don't know what the effect of this would be; presumably something unsual would happen during printing. Another example on the Mac II is HUnlock. This one seems to be fixing a bug in the QuickDraw picture code, having to do with color tables. I hope this helps. Larry Rosenstein, Apple Computer, Inc. Object Specialist Internet: lsr@Apple.com UUCP: {nsc, sun}!apple!lsr AppleLink: Rosenstein1