[llvm] r244177 - [libFuzzer] avoid build warnings in non-assert build (useful warning in this case)

Kostya Serebryany kcc at google.com
Wed Aug 5 16:44:42 PDT 2015


Author: kcc
Date: Wed Aug  5 18:44:42 2015
New Revision: 244177

URL: http://llvm.org/viewvc/llvm-project?rev=244177&view=rev
Log:
[libFuzzer] avoid build warnings in non-assert build (useful warning in this case)

Modified:
    llvm/trunk/lib/Fuzzer/FuzzerTraceState.cpp

Modified: llvm/trunk/lib/Fuzzer/FuzzerTraceState.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Fuzzer/FuzzerTraceState.cpp?rev=244177&r1=244176&r2=244177&view=diff
==============================================================================
--- llvm/trunk/lib/Fuzzer/FuzzerTraceState.cpp (original)
+++ llvm/trunk/lib/Fuzzer/FuzzerTraceState.cpp Wed Aug  5 18:44:42 2015
@@ -419,7 +419,10 @@ void Fuzzer::InitializeTraceState() {
   for (size_t i = 0; i < static_cast<size_t>(Options.MaxLen); i++) {
     dfsan_label L = dfsan_create_label("input", (void*)(i + 1));
     // We assume that no one else has called dfsan_create_label before.
-    assert(L == i + 1);
+    if (L != i + 1) {
+      Printf("DFSan labels are not starting from 1, exiting\n");
+      exit(1);
+    }
   }
 }
 




More information about the llvm-commits mailing list