]> granicus.if.org Git - llvm/commitdiff
[libFuzzer] Use stoull instead of stol to ensure 64 bits.
authorMarcos Pividori <mpividori@google.com>
Fri, 10 Feb 2017 18:44:14 +0000 (18:44 +0000)
committerMarcos Pividori <mpividori@google.com>
Fri, 10 Feb 2017 18:44:14 +0000 (18:44 +0000)
Differential revision: https://reviews.llvm.org/D29831

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@294769 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Fuzzer/FuzzerTracePC.cpp

index 661ad23a8e34edfe3591ef265e77b340258d01f6..d1f6441b6b27a5cdc1d98197e4aa453491014088 100644 (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;