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
+2 -1
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;
}
}