[fpc-pascal]RE: The inexplicable overflow.

A.J. Venter ddt at headrush.co.za
Fri Sep 27 15:28:51 CEST 2002

On Fri, 27 Sep 2002, Pierre Muller wrote:

After significant further searches and hacking the problem still evades 
me. However, I have since learned that it is apparently not an overflow.

The value certainly does switch to maxint and then to 0 (which is why I 
thought it was an overflow) but compiling with range checking and overflow 
checking does not crash the program when it happens. 

In other words, it hits maxint and then 0 but never exceeds maxint. What's 
even funnier is that it does not build up to maxint, it simple becomes it 
out of the blue and without warning.

I went so far as to do a text search for the line where.Y throughout all 
the source code, but I didn't find any lines accessing this value directly 
except the two which are changed when a character move, and these are just
inc and dec's. If the problem was here, then surely it could not reach 
maxint directly - especially as these lines are often not being executed 
at the time of the bug.

The most perplexing thing remains the fact that only the player seems to 
suffer this, the enemies (like I said, different instantiations of the 
same object) are completely untouched.

I will asume by now that nobody here is interested in joining the project 
(hint, hint) and just hope for some good advice.

Thank you all though, the advice from this list has solved many, many 
problems for me over a very long time.

A.J. Venter

More information about the fpc-pascal mailing list