From e81f9cc63df164df8bb075fd14fb519e48631081 Mon Sep 17 00:00:00 2001 From: Marcos Pividori Date: Fri, 10 Feb 2017 18:44:14 +0000 Subject: [libFuzzer] Use stoull instead of stol to ensure 64 bits. Differential revision: https://reviews.llvm.org/D29831 llvm-svn: 294769 --- llvm/lib/Fuzzer/FuzzerTracePC.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'llvm/lib') diff --git a/llvm/lib/Fuzzer/FuzzerTracePC.cpp b/llvm/lib/Fuzzer/FuzzerTracePC.cpp index 661ad23a8e3..d1f6441b6b2 100644 --- a/llvm/lib/Fuzzer/FuzzerTracePC.cpp +++ b/llvm/lib/Fuzzer/FuzzerTracePC.cpp @@ -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(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; -- cgit v1.2.3