Corrected method relating to use of array notation in the base

use name (not part of an array in magic).  This was failing in
ext2spice due to code in extflat dealing incorrectly with the
array delimiters.  The correction fixes the problem but leaves
the possibility that there could be a conflict between a use
name that is an array and a use name that has the array index
as part of the name.
This commit is contained in:
Tim Edwards 2019-10-01 19:32:52 -04:00
parent 091d7ba2ae
commit 798e87deaf
2 changed files with 17 additions and 20 deletions

View File

@ -1576,24 +1576,22 @@ esMakePorts(hc, cdata)
bool is_array;
/* Ignore array information for the purpose of tracing */
/* the cell definition hierarchy. Complementary to the */
/* method used in EFbuild.c, only consider uses of */
/* brackets that conform to the [ax:bx:cx][ay:by:cy] */
/* notation. */
/* the cell definition hierarchy. If a cell use name */
/* contains a bracket, check first if the complete name */
/* matches a use. If not, then check if the part */
/* the last opening bracket matches a known use. */
aptr = strchr(portname, '[');
if (aptr && (aptr < tptr) &&
(sscanf(aptr, "[%d:%d:%d][%d:%d:%d]",
&idum[0], &idum[1], &idum[2],
&idum[3], &idum[4], &idum[5]) == 6))
aptr = strrchr(portname, '[');
*tptr = '\0';
is_array = FALSE;
if (aptr != NULL)
{
is_array = TRUE;
*aptr = '\0';
}
else
{
is_array = FALSE;
*tptr = '\0';
he = HashFind(&updef->def_uses, portname);
if (he == NULL)
{
*aptr = '\0';
is_array = TRUE;
}
}
// Find the cell for the instance
@ -1606,8 +1604,7 @@ esMakePorts(hc, cdata)
}
if (is_array)
*aptr = '[';
else
*tptr = '/';
*tptr = '/';
portname = tptr + 1;
// Find the net of portname in the subcell and

View File

@ -553,8 +553,8 @@ efBuildDeviceParams(name, argc, argv)
if (name[0] == ':')
{
newparm->parm_name = StrDup((char **)NULL, argv[n]);
newparm->parm_type[1] = '0' + n / 10;
newparm->parm_type[0] = '0' + n % 10;
newparm->parm_type[0] = '0' + n / 10;
newparm->parm_type[1] = '0' + n % 10;
}
else
newparm->parm_name = StrDup((char **)NULL, pptr + 1);