Commit 529f34e0 authored by Max Moroz's avatar Max Moroz Committed by Commit Bot

SQLite: harden the condition for enabling asserts (&& use_sanitizer_coverage).

TBR=pwnall@chromium.org

Bug: 906634
Change-Id: I0d457be636e330a06915bff1750da03d90746d16
Reviewed-on: https://chromium-review.googlesource.com/c/1341921Reviewed-by: default avatarMax Moroz <mmoroz@chromium.org>
Commit-Queue: Max Moroz <mmoroz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#609337}
parent a8397534
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
# found in the LICENSE file. # found in the LICENSE file.
import("//build/config/dcheck_always_on.gni") import("//build/config/dcheck_always_on.gni")
import("//build/config/sanitizers/sanitizers.gni")
import("//testing/libfuzzer/fuzzer_test.gni") import("//testing/libfuzzer/fuzzer_test.gni")
# Compile-time options passed to SQLite. # Compile-time options passed to SQLite.
...@@ -188,7 +189,8 @@ config("chromium_sqlite3_compile_options") { ...@@ -188,7 +189,8 @@ config("chromium_sqlite3_compile_options") {
} }
} }
if (use_fuzzing_engine && (is_debug || dcheck_always_on)) { if (use_fuzzing_engine && use_sanitizer_coverage &&
(is_debug || dcheck_always_on)) {
# Enable SQLite's assert() macros. # Enable SQLite's assert() macros.
defines += [ "SQLITE_DEBUG" ] defines += [ "SQLITE_DEBUG" ]
...@@ -208,10 +210,11 @@ config("sqlite_warnings") { ...@@ -208,10 +210,11 @@ config("sqlite_warnings") {
# sqlite3Fts3InitTok). # sqlite3Fts3InitTok).
cflags += [ "-Wno-unused-function" ] cflags += [ "-Wno-unused-function" ]
if (use_fuzzing_engine && (is_debug || dcheck_always_on)) { if (use_fuzzing_engine && use_sanitizer_coverage &&
(is_debug || dcheck_always_on)) {
cflags += [ cflags += [
"-Wno-implicit-function-declaration", "-Wno-implicit-function-declaration",
"-Wno-string-conversion" "-Wno-string-conversion",
] ]
} }
} }
...@@ -376,9 +379,7 @@ if (is_linux) { ...@@ -376,9 +379,7 @@ if (is_linux) {
} }
fuzzer_test("sqlite3_ossfuzz_fuzzer") { fuzzer_test("sqlite3_ossfuzz_fuzzer") {
include_dirs = [ include_dirs = [ "." ]
".",
]
sources = [ sources = [
"src/test/ossfuzz.c", "src/test/ossfuzz.c",
] ]
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment