home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / sys / mac / programm / 18629 < prev    next >
Encoding:
Text File  |  1992-11-18  |  1.8 KB  |  40 lines

  1. Newsgroups: comp.sys.mac.programmer
  2. Path: sparky!uunet!ornl!rsg1.er.usgs.gov!darwin.sura.net!news.udel.edu!chopin.udel.edu!kurisuto
  3. From: kurisuto@chopin.udel.edu (Sean J. Crist)
  4. Subject: Problem isolated but not understood (THINK Pascal standalone crash)
  5. Message-ID: <Bxy3q0.231@news.udel.edu>
  6. Sender: usenet@news.udel.edu
  7. Nntp-Posting-Host: chopin.udel.edu
  8. Organization: University of Delaware
  9. Date: Thu, 19 Nov 1992 04:13:11 GMT
  10. Lines: 28
  11.  
  12. As I recently posted, I have a crash which occurs when I compile my
  13. program as a stand-alone application, but not when I run in the THINK 
  14. Pascal environment.  Using Macsbug, and by inserting Sysbeeps into
  15. my code, I've isolated the problem to a call to BlockMove.  
  16.  
  17. What I'm trying to do is completely copy the contents of one handle
  18. into another (actually these are typecast handles, but that shouldn't
  19. make any difference- to the operating system they're the same).
  20. I first set the destination handle to the size of the source handle, 
  21. then call BlockMove to copy the contents from one handle to the other.
  22. It is on this BlockMove that the crash occurs.  The code looks like this:
  23.  
  24. SetHandleSize(Handle(DestinationHandle), GetHandleSize
  25.     (Handle(SourceHandle))); {Make the two handles the same size}
  26. BlockMove(Pointer(SourceHandle^), Pointer(DestinationHandle^),
  27.     GetHandleSize(Handle(SourceHandle))); {Copy the contents 
  28.     of one handle into the other}
  29.  
  30. I believe both handles to be valid going in.  The crash is a bus
  31. error which says something about 'supervisor space' (I forget the exact
  32. wording).  This crash never occurs in the THINK Pascal run environment.
  33. Does anyone have any idea why this is crashing in the stand-alone
  34. application?  Several of the people who answered to my earlier
  35. posting mentioned problems with pointers.  Is there something wrong
  36. with using the word 'pointer' as I am?
  37.  
  38. --Kurisuto
  39.  
  40.