Fix misc bad-syntax crashes, bug1533.

This commit is contained in:
Wilson Snyder 2019-09-30 20:00:30 -04:00
parent 9eaec3b5c1
commit 239ef1ae6d
2 changed files with 3 additions and 2 deletions

View File

@ -22,7 +22,7 @@ The contributors that suggested a given feature are shown in []. Thanks!
**** Fix ugly error on interface misuse, bug1525. [Bogdan Vukobratovic]
**** Fix misc bad-syntax crashes, bug1529-bug1530, bug1532. [Eric Rippey]
**** Fix misc bad-syntax crashes, bug1529-bug1533. [Eric Rippey]
* Verilator 4.018 2019-08-29

View File

@ -113,7 +113,8 @@ string AstNode::encodeName(const string& namein) {
// a user identifier nor a temp we create in Verilator.
// We also do *NOT* use __DOT__ etc, as we search for those
// in some replacements, and don't want to mangle the user's names.
char hex[10]; sprintf(hex, "__0%02X", pos[0]);
unsigned val = pos[0] & 0xff; // Mask to avoid sign extension
char hex[10]; sprintf(hex, "__0%02X", val);
out += hex;
}
}