[libFuzzer] Use stoull instead of stol to ensure 64 bits.

Differential revision: https://reviews.llvm.org/D29831

llvm-svn: 294769
This commit is contained in:
Marcos Pividori 2017-02-10 18:44:14 +00:00
parent 8c31ea917a
commit e81f9cc63d
1 changed files with 2 additions and 2 deletions

View File

@ -138,7 +138,7 @@ void TracePC::PrintCoverage() {
sizeof(ModulePathRaw), &OffsetRaw))
continue;
std::string Module = ModulePathRaw;
uintptr_t FixedPC = std::stol(FixedPCStr, 0, 16);
uintptr_t FixedPC = std::stoull(FixedPCStr, 0, 16);
uintptr_t PcOffset = reinterpret_cast<uintptr_t>(OffsetRaw);
ModuleOffsets[Module] = FixedPC - PcOffset;
CoveredPCsPerModule[Module].push_back(PcOffset);
@ -183,7 +183,7 @@ void TracePC::PrintCoverage() {
if (PcOffsetEnd == std::string::npos)
continue;
S.resize(PcOffsetEnd);
uintptr_t PcOffset = std::stol(S, 0, 16);
uintptr_t PcOffset = std::stoull(S, 0, 16);
if (!std::binary_search(CoveredOffsets.begin(), CoveredOffsets.end(),
PcOffset)) {
uintptr_t PC = ModuleOffset + PcOffset;