SWDEV-423946 - Make hash string to int conversion platform independent

The "long" type size seems to be platform dependent, causing hash value
overflow on implementations where "long" is 4 bytes. This addresses the
scenario.

Change-Id: I4e3c0df457e35b139dcc496d832210ba2cb849ba
Αυτή η υποβολή περιλαμβάνεται σε:
Vikram
2023-11-09 05:42:06 -05:00
υποβλήθηκε από Vikram Hegde
γονέας 1c442658ca
υποβολή 1f8ead914a
@@ -260,7 +260,9 @@ bool populateFormatStringHashMap(
for (auto it : printfInfo) {
auto Delim = it.fmtString_.find_first_of(',');
auto HashStr = it.fmtString_.substr(0, Delim);
auto HashVal = strtoul(HashStr.c_str(), NULL, 16);
static_assert(sizeof(long long) == sizeof(uint64_t), "unexpected long long type width");
auto HashVal = std::strtoull(HashStr.c_str(), NULL, 16);
if (strMap.find(HashVal) != strMap.end()) {
LogError("Hash value collision detected, printf buffer ill formed");
return false;