From f1f4b82a30d1a9b81a51e5c3c30561ec82b90fbd Mon Sep 17 00:00:00 2001 From: "R. Timothy Edwards" Date: Fri, 16 May 2025 19:36:16 -0400 Subject: [PATCH] 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. --- VERSION | 2 +- lef/lefRead.c | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/VERSION b/VERSION index 94960bbb..36d1adb8 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -8.3.526 +8.3.527 diff --git a/lef/lefRead.c b/lef/lefRead.c index cccee7fe..df5c2ab6 100644 --- a/lef/lefRead.c +++ b/lef/lefRead.c @@ -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) {