X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f From: Paul Wilkins User-Agent: Mozilla Thunderbird 0.6 (Windows/20040502) X-Accept-Language: en MIME-Version: 1.0 Newsgroups: comp.os.msdos.djgpp Subject: Re: strange error References: <2914-Sat24Jul2004104537+0300-eliz AT gnu DOT org> <20040725013214 DOT 18573 DOT 00000172 AT mb-m22 DOT aol DOT com> In-Reply-To: <20040725013214.18573.00000172@mb-m22.aol.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Lines: 36 Message-ID: Date: Mon, 26 Jul 2004 18:44:37 +1200 NNTP-Posting-Host: 218.101.50.29 X-Complaints-To: abuse AT tsnz DOT net X-Trace: news02.tsnz.net 1090824288 218.101.50.29 (Mon, 26 Jul 2004 18:44:48 NZST) NNTP-Posting-Date: Mon, 26 Jul 2004 18:44:48 NZST Organization: TelstraClear To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com 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