Skip to content

Commit

Permalink
Fix EDIFTokenizer.tokenTooLong() for tokens that wrap around
Browse files Browse the repository at this point in the history
Signed-off-by: Eddie Hung <[email protected]>
  • Loading branch information
eddieh-xlnx committed Feb 21, 2024
1 parent 81b2c93 commit 641b1e8
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/com/xilinx/rapidwright/edif/EDIFTokenizer.java
Original file line number Diff line number Diff line change
Expand Up @@ -199,9 +199,10 @@ private String getQuotedToken(boolean isShortLived) throws IOException {
return token;
}

private IOException tokenTooLong(int bufferOffset) {
private IOException tokenTooLong(int startOffset) {
final long byteOffsetAtStart = this.byteOffset;
final String failingToken = getUniqueToken(bufferOffset, bufferOffset + 150, true);
final int endOffset = bufferAddressMask & (startOffset + 150);
final String failingToken = getUniqueToken(startOffset, endOffset, true);
throw new TokenTooLongException("ERROR: String buffer overflow on byte offset " +
byteOffsetAtStart + " parsing token starting with "+ failingToken +"...\n\t Please revisit why this EDIF token "
+ "is so long or increase the buffer in " + this.getClass().getCanonicalName());
Expand Down

0 comments on commit 641b1e8

Please sign in to comment.