[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:12:41 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);
I guess we can do `if (A < 8) return A` here and remove another check from line #281.

  rCRT Compiler Runtime


More information about the llvm-commits mailing list