Message-ID: <331707EE.1A29@ix.netcom.com>
Date: Fri, 28 Feb 1997 11:29:34 -0500
From: "Daniel S. Hayes" <dsh12@ix.netcom.com>
Reply-To: dsh12@ix.netcom.com
Organization: AMS
X-Mailer: Mozilla 3.01Gold (WinNT; I)
MIME-Version: 1.0
Newsgroups: comp.lang.smalltalk
Subject: valueNowOrOnUnwindDo: 
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: dhayes
Lines: 45
Path: cantaloupe.srv.cs.cmu.edu!bb3.andrew.cmu.edu!nntp.sei.cmu.edu!news.cis.ohio-state.edu!news.maxwell.syr.edu!newsfeeds.sol.net!hammer.uoregon.edu!zephyr.texoma.net!uunet!in1.uu.net!162.70.244.3!dns.amsinc.com!dhayes

Hi all.
I am getting the error: "Attempt to free an unallocated or corrupt
block".  Well, the error is occuring in the snippet of code below.  The
snippet is taken form the class SybaseSession.  This is Sybase's
database connection class.  xif is an instance of this class.  Anyway,
my question is based around the functioning of the
"valueNowOrOnUnwindDo:" method.

Before this method enters the valueNowOrOnUnwindDo: block, the temp
variable br has the value of a new array, #(#nil #nil #nil) (numRets is
equal to 3).  "self returnParameters: br" set the instance variable
returnParameters to equal the value of br.  Then the
valueNowOrOnUnwindDo: block is entered and the program blows and MacBugs
catches it (DBUNLOCKLIB simply returns self.  A compatability method). 
Next I enter the "G" command (MacBugs continue command) several times
until VW regains control.  This time, however, the value of br and
returnParameters has changed to a value I believe they were set to
earlier in the program; a value one would expect to see.
Question: does valueNowOrOnUnwindDo: method roll back the method to a
point when the instance was valid?


self halt.
(template := self bindReturnParameters) notNil
	ifTrue: ["None, therefore, nothing more to do."
		"We had at least one."
		br := template copy]
	ifFalse: [br := Array new: numRets].
		self returnParameters: br.
	[.....
	.........this block is skipped over......
	]
		valueNowOrOnUnwindDo: [xif DBUNLOCKLIB]]

Thanks,


-- 
Daniel S. Hayes (VW 2.5)
American Management Systems (AMS)
12601 Fair Lakes Circle
Fairfax, VA  22033
703-227-5615 w
800-242-8143 x5615 (work voice mail)
mailto:dsh12@ix.netcom.com
