'this' Segement must be in Heap range in ...

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

'this' Segement must be in Heap range in ...

agnesi
Anyone familiar enough with the VMEmulator to interpret this error I'm getting ;
'this' Segement must be in Heap range in Block.getX1.2

I'm working on a Snake game. Block is class and getX1() is a method of the Block class but I'm not sure what this error is trying to tell me.

Joe
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: 'this' Segement must be in Heap range in ...

cadet1620
Administrator
agnesi wrote
Anyone familiar enough with the VMEmulator to interpret this error I'm getting ;
'this' Segement must be in Heap range in Block.getX1.2
I just checked the source. This error is generated when a  'pop pointer 0' command sets a value < 2048 or > 16383 into the this pointer.

Did you call a method on an unallocated object? An unallocated object's pointer will be 0.

--Mark
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: 'this' Segement must be in Heap range in ...

agnesi
hmmm, I don't believe so but it was in the midst of a recursive function so perhaps..at any rate I got rid of the recursion and now my program works fine. Thank you for looking into it though.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: 'this' Segement must be in Heap range in ...

cadet1620
Administrator
agnesi wrote
hmmm, I don't believe so but it was in the midst of a recursive function so perhaps..at any rate I got rid of the recursion and now my program works fine. Thank you for looking into it though.
The stack starts at 256 and the heap starts at 2048 so there are only 1792 words of stack available.  If there is no stack overflow checking in the VM emulator, your recursive code may have been stacking into the heap and corrupting dynamically allocated objects.

--Mark
Loading...