Corrected two errors in the serial combine function, one which

misses a device if it has been already moved due to earlier
merging in the serial combine routine, and runs off the end of
the list;  the other if the pin check routine falls on the last
device in the list, leading to an incorrect check for a record
where there is only a NULL.
This commit is contained in:
Tim Edwards 2017-10-10 22:24:09 -04:00
parent ccbb286cf3
commit b5f188de42
1 changed files with 10 additions and 2 deletions

View File

@ -3309,7 +3309,9 @@ int check_pin_nodes(struct objlist *ob1, struct objlist *ob2)
pob = pob->next;
}
if (nob->type > FIRSTPIN || pob->type > FIRSTPIN) return FALSE;
if (nob && pob && (nob->type > FIRSTPIN || pob->type > FIRSTPIN))
return FALSE;
return TRUE;
}
@ -3486,7 +3488,13 @@ int CombineSerial(char *model, int file)
/* only pointer to it. */
for (obp = instlist[i][0]; obp->next->type > FIRSTPIN ||
obp->next->type == PROPERTY; obp = obp->next);
for (ob2 = obp; ob2->next != instlist[i][1]; ob2 = ob2->next);
for (ob2 = obp; ob2 && ob2->next != instlist[i][1]; ob2 = ob2->next);
/* Device may have been moved by the above code. If so, look for */
/* it from the beginning of the list. */
if (ob2 == NULL)
for (ob2 = tp->cell; ob2->next != instlist[i][1]; ob2 = ob2->next);
for (obs = ob2->next; obs->next && (obs->next->type > FIRSTPIN
|| obs->next->type == PROPERTY); obs = obs->next);
ob2->next = obs->next;