[futurebasic] RE: [FB] FB 5 Memory Error

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : August 2009 : Group Archive : Group : All Groups

From: "Edwards, Waverly" <Waverly.Edwards@...>
Date: Mon, 31 Aug 2009 08:49:39 -0500
Unfortunately I don't understand the error.

local fn foo( @x as ptr ) // <- incoming var is a pointer to an address
long if ( x.0& != 0 )     // <- dereference var, essentially peek long(x)
// show silly alert, then crash
xelse
// something sensible
end if
end fn

Just for my understanding, what's wrong with this.  I'm probably overlooking
something obvious.  Unless your dereferencing a non-existent address???


W.

-----Original Message-----
From: Robert Purves [mailto:listrp@...] 
Sent: Monday, August 31, 2009 3:47 AM
To: futurebasic@...
Subject: Re: [FB] FB 5 Memory Error


Ken Shmidheiser wrote:

> I just noticed the warning and crash appear to occur when I am  
> typing a "?" (question mark).

There's a function in the editor that decides whether to convert a  
typed '?' into 'print' then inserts the result. I can't reproduce your  
bug, but I found and fixed a Really Obvious uninitialised variable in  
the insertion call.

With luck this is a true fix; it will be in the forthcoming FB 5.4  
release.

The perilous bug-in-waiting escaped notice until now because the  
compiler doesn't give a warning for usage like this:

local fn foo( @x as ptr )
long if ( x.0& != 0 )
// show silly alert, then crash
xelse
// something sensible
end if
end fn

local fn bar
dim as long  uninit
fn foo( uninit )
end fn


Robert P.

--
To unsubscribe, send ANY message to: futurebasic-unsubscribe@...