Mail Archives: djgpp/2004/07/26/02:45:30
Sterten wrote:
> Eli wrote:
>
> >> only the final one, where it crashed
> >
> >Sure; but that's better than what you have now (which is nothing
> >except guesses).
>
> I'm 90% sure, that it's the line which I posted,
> m55:r--;if(R[r]!=1)goto m55; and then r becomes negative.
> Then I assume r runs into array Sym[99][99] which was initialized
> immediately before R99]. It should stop at Sym[16][16] which
> should be the first entry which is =1. Then presumably r is
> 0-99*99+16*16=-9545 (modulo modifications due to starting at 1 vs.0,
> I'm too lazy to check this)
> Then the next line is c=C[r] .. then setting R[9562]=0 which is
> about 9000*4 bytes behind the last defined data-area-element ...
> then setting C[c]=0 and I don't really know, what value
> c=C[-9545] is here.
> Somewhere here the program crashes (or not).
It crashes because r, the array index, becomes negative and then keeps
going back to -102 whereupon it crashes.
If I'm to understand your thinking, you have in memory the Sym[][] array
and just after that the R[] array, and you want to use R[r] to count
from the R[] array down to a location in the Sym[][] array?
Don't get me wrong on this, but if that's the case then you'll need to
find some other method to achieve your intended objective.
it's no wonder your program isn't behaving as expected.
--
Paul Wilkins
- Raw text -