Skip to content

Commit

Permalink
[JSC] Suppress coverage_sanitizer on Fuzzilli::initializeCoverage()
Browse files Browse the repository at this point in the history
https://bugs.webkit.org/show_bug.cgi?id=265507
<rdar://118908398>

Reviewed by Yusuke Suzuki.

* Source/JavaScriptCore/fuzzilli/Fuzzilli.cpp:
(Fuzzilli::initializeCoverage):
- Suppress coverage sanitizer when initializing coverage.

* Source/WTF/wtf/Compiler.h:
(COVERAGE_ENABLED): Add.
(SUPPRESS_COVERAGE): Add.
- Add macros used with -fsanitize-coverage.

Canonical link: https://commits.webkit.org/271277@main
  • Loading branch information
David Kilzer authored and ddkilzer committed Nov 29, 2023
1 parent f40b359 commit df1c826
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Source/JavaScriptCore/fuzzilli/Fuzzilli.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@

#include <mutex>
#include <wtf/Assertions.h>
#include <wtf/Compiler.h>
#include <wtf/DataLog.h>
#include <wtf/NeverDestroyed.h>

Expand Down Expand Up @@ -77,6 +78,7 @@ void Fuzzilli::waitForCommand()
RELEASE_ASSERT_WITH_MESSAGE(action == 'cexe', "[REPRL] Unknown action: %u", action);
}

SUPPRESS_COVERAGE
void Fuzzilli::initializeCoverage(uint32_t* start, uint32_t* stop)
{
RELEASE_ASSERT_WITH_MESSAGE(!edgesStart && !edgesStop, "Coverage instrumentation is only supported for a single module");
Expand Down
10 changes: 10 additions & 0 deletions Source/WTF/wtf/Compiler.h
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,16 @@
#define SUPPRESS_TSAN
#endif

/* COVERAGE_ENABLED and SUPPRESS_COVERAGE */

#define COVERAGE_ENABLED COMPILER_HAS_CLANG_FEATURE(coverage_sanitizer)

#if COVERAGE_ENABLED
#define SUPPRESS_COVERAGE __attribute__((no_sanitize("coverage")))
#else
#define SUPPRESS_COVERAGE
#endif

/* ==== Compiler-independent macros for various compiler features, in alphabetical order ==== */

/* ALWAYS_INLINE */
Expand Down

0 comments on commit df1c826

Please sign in to comment.