[PATCH] D41457: [libfuzzer] Fix UB when calculating Log(0) in StackDepthStepFunction().

Max Moroz via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 20 11:32:31 PST 2017


Dor1s added inline comments.


================
Comment at: lib/fuzzer/FuzzerTracePC.h:279
   auto StackDepthStepFunction = [](uint32_t A) -> uint32_t {
+    if (!A) return A;
     uint32_t Log2 = Log(A);
----------------
Dor1s wrote:
> I guess we can do `if (A < 8) return A` here and remove another check from line #281.
or maybe even `1 << 3` instead of `8`. Either way, landing what you've approved. Thanks!


Repository:
  rCRT Compiler Runtime

https://reviews.llvm.org/D41457





More information about the llvm-commits mailing list