[PATCH] D28633: [libFuzzer] Portable implementation of `IsInterestingCoverageFile()`.
Marcos Pividori via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Jan 12 19:25:33 PST 2017
mpividori updated this revision to Diff 84211.
https://reviews.llvm.org/D28633
Files:
lib/Fuzzer/FuzzerIO.h
lib/Fuzzer/FuzzerIOPosix.cpp
lib/Fuzzer/FuzzerIOWindows.cpp
lib/Fuzzer/FuzzerTracePC.cpp
Index: lib/Fuzzer/FuzzerTracePC.cpp
===================================================================
--- lib/Fuzzer/FuzzerTracePC.cpp
+++ lib/Fuzzer/FuzzerTracePC.cpp
@@ -72,18 +72,6 @@
HandleValueProfile(Idx);
}
-static bool IsInterestingCoverageFile(std::string &File) {
- if (File.find("compiler-rt/lib/") != std::string::npos)
- return false; // sanitizer internal.
- if (File.find("/usr/lib/") != std::string::npos)
- return false;
- if (File.find("/usr/include/") != std::string::npos)
- return false;
- if (File == "<null>")
- return false;
- return true;
-}
-
void TracePC::InitializePrintNewPCs() {
if (!DoPrintNewPCs) return;
assert(!PrintedPCs);
Index: lib/Fuzzer/FuzzerIOWindows.cpp
===================================================================
--- lib/Fuzzer/FuzzerIOWindows.cpp
+++ lib/Fuzzer/FuzzerIOWindows.cpp
@@ -277,6 +277,16 @@
return FileName.substr(0, LocationLen + DirLen);
}
+bool IsInterestingCoverageFile(const std::string &FileName) {
+ if (FileName.find("Program Files") != std::string::npos)
+ return false;
+ if (FileName.find("compiler-rt\\lib\\") != std::string::npos)
+ return false; // sanitizer internal.
+ if (FileName == "<null>")
+ return false;
+ return true;
+}
+
} // namespace fuzzer
#endif // LIBFUZZER_WINDOWS
Index: lib/Fuzzer/FuzzerIOPosix.cpp
===================================================================
--- lib/Fuzzer/FuzzerIOPosix.cpp
+++ lib/Fuzzer/FuzzerIOPosix.cpp
@@ -83,6 +83,18 @@
return Res;
}
+bool IsInterestingCoverageFile(const std::string &FileName) {
+ if (FileName.find("compiler-rt/lib/") != std::string::npos)
+ return false; // sanitizer internal.
+ if (FileName.find("/usr/lib/") != std::string::npos)
+ return false;
+ if (FileName.find("/usr/include/") != std::string::npos)
+ return false;
+ if (FileName == "<null>")
+ return false;
+ return true;
+}
+
} // namespace fuzzer
#endif // LIBFUZZER_POSIX
Index: lib/Fuzzer/FuzzerIO.h
===================================================================
--- lib/Fuzzer/FuzzerIO.h
+++ lib/Fuzzer/FuzzerIO.h
@@ -37,6 +37,8 @@
// Returns the name of the dir, similar to the 'dirname' utility.
std::string DirName(const std::string &FileName);
+bool IsInterestingCoverageFile(const std::string &FileName);
+
void DupAndCloseStderr();
void CloseStdout();
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D28633.84211.patch
Type: text/x-patch
Size: 2371 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170113/32de4d72/attachment.bin>
More information about the llvm-commits
mailing list