1
0
mirror of https://github.com/fachat/xa65.git synced 2024-06-29 13:29:27 +00:00

Fix memory pointer bug if index is -1

This commit is contained in:
fachat 2012-07-29 19:05:02 +02:00
parent f25481778b
commit 0bb027f032

View File

@ -608,8 +608,10 @@ static int ll_def(char *s, int *n, int b, label_t ltype)
ltp->blknext = -1; // no next block
ltp->blkprev = b_link( afile->la.lti ); // previous block, linked within block
ltp = afile->la.lt + ltp->blkprev;
ltp->blknext = afile->la.lti;
if (ltp->blkprev != -1) {
ltp = afile->la.lt + ltp->blkprev;
ltp->blknext = afile->la.lti;
}
*n=afile->la.lti; // return the list index for that file in the out parameter n
afile->la.lti++; // increase last index in lable table