[libFuzzer] honour -only_ascii=1 when reading the initial corpus. Also, remove ugly...
[oota-llvm.git] / lib / Fuzzer / FuzzerUtil.cpp
index e76adb37481ce400e64a6b3db06e6956fc79ae4a..b04d76d316d81541f95d36463006b410f0a11253 100644 (file)
@@ -86,4 +86,10 @@ bool ToASCII(Unit &U) {
   return Changed;
 }
 
+bool IsASCII(const Unit &U) {
+  for (auto X : U)
+    if (!(isprint(X) || isspace(X))) return false;
+  return true;
+}
+
 }  // namespace fuzzer