[PATCH] D29831: [libFuzzer] Use long long to ensure 64 bits.

Marcos Pividori via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 10 09:20:20 PST 2017


mpividori created this revision.

This fix errors when compiling for 64 bits on Windows, where longs are 4 bytes.


https://reviews.llvm.org/D29831

Files:
  lib/Fuzzer/FuzzerTracePC.cpp


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


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D29831.88009.patch
Type: text/x-patch
Size: 960 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170210/24cac53f/attachment.bin>


More information about the llvm-commits mailing list