[compiler-rt] 747e0d9 - [compiler-rt] Use std::clamp (NFC)

Kazu Hirata via llvm-commits llvm-commits at lists.llvm.org
Sun Oct 22 12:32:27 PDT 2023


Author: Kazu Hirata
Date: 2023-10-22T12:32:20-07:00
New Revision: 747e0d9f0aadb4933ee7bc80abed67bdde23033f

URL: https://github.com/llvm/llvm-project/commit/747e0d9f0aadb4933ee7bc80abed67bdde23033f
DIFF: https://github.com/llvm/llvm-project/commit/747e0d9f0aadb4933ee7bc80abed67bdde23033f.diff

LOG: [compiler-rt] Use std::clamp (NFC)

Added: 
    

Modified: 
    compiler-rt/lib/fuzzer/FuzzerLoop.cpp

Removed: 
    


################################################################################
diff  --git a/compiler-rt/lib/fuzzer/FuzzerLoop.cpp b/compiler-rt/lib/fuzzer/FuzzerLoop.cpp
index 8b430c5428d880d..935dd2342e18f86 100644
--- a/compiler-rt/lib/fuzzer/FuzzerLoop.cpp
+++ b/compiler-rt/lib/fuzzer/FuzzerLoop.cpp
@@ -799,7 +799,7 @@ void Fuzzer::ReadAndExecuteSeedCorpora(std::vector<SizedFile> &CorporaFiles) {
     TotalSize += File.Size;
   }
   if (Options.MaxLen == 0)
-    SetMaxInputLen(std::min(std::max(kMinDefaultLen, MaxSize), kMaxSaneLen));
+    SetMaxInputLen(std::clamp(MaxSize, kMinDefaultLen, kMaxSaneLen));
   assert(MaxInputLen > 0);
 
   // Test the callback with empty input and never try it again.


        


More information about the llvm-commits mailing list