Corrected an error caused by extending the parsing of the FOREIGN

keyword in LEF.  FOREIGN may take an origin offset, but it is
optional.  The routine to check that there were no offset values
in the statement incorrectly checked for a NULL token instead of
a value ";" which would indicate an end-of-statement.
This commit is contained in:
R. Timothy Edwards 2025-05-16 19:36:16 -04:00
parent 02669de267
commit f1f4b82a30
2 changed files with 8 additions and 2 deletions

View File

@ -1 +1 @@
8.3.526
8.3.527

View File

@ -881,6 +881,7 @@ LefReadLefPoint(
token = LefNextToken(f, TRUE);
if (!token) return -1;
if (*token == ';') return -1;
if (*token == '(')
{
token = LefNextToken(f, TRUE);
@ -2350,7 +2351,7 @@ origin_error:
/* Read (optional) FOREIGN coordinate */
result = LefReadLefPoint(f, &x, &y);
if (result == 1) goto origin_error;
if (result == 1) goto foreign_error;
else if (result == 0)
{
gdsOffset.p_x += -(int)roundf(x / oscale);
@ -2364,6 +2365,11 @@ origin_error:
}
LefEndStatement(f);
break;
foreign_error:
LefError(LEF_ERROR, "Bad origin in macro FOREIGN; requires "
"0 or 2 values.\n");
LefEndStatement(f);
break;
case LEF_MACRO_END:
if (LefParseEndStatement(f, mname) == 0)
{