Commit a74f8ccd authored by Max Moroz's avatar Max Moroz Committed by Commit Bot

SQLite: define SQLITE_DEBUG if (is_debug || dcheck_always_on).

We use this flag on OSS-Fuzz and trigger various asserts with fuzzing:
https://bugs.chromium.org/p/oss-fuzz/issues/list?can=1&q=label%3AProj-sqlite3&colspec=ID+Type+Component+Status+Proj+Reported+Owner+Summary&cells=ids


R=palmer@chromium.org, pwnall@chromium.org

Bug: 900910
Change-Id: I223ad95a9626e016c99ed5cecbf6f084cba8f331
Reviewed-on: https://chromium-review.googlesource.com/c/1315959
Commit-Queue: Max Moroz <mmoroz@chromium.org>
Reviewed-by: default avatarChris Palmer <palmer@chromium.org>
Reviewed-by: default avatarVictor Costan <pwnall@chromium.org>
Cr-Commit-Position: refs/heads/master@{#608840}
parent 4c95576e
...@@ -188,7 +188,10 @@ config("chromium_sqlite3_compile_options") { ...@@ -188,7 +188,10 @@ config("chromium_sqlite3_compile_options") {
} }
} }
if (is_debug || dcheck_always_on) { if (use_fuzzing_engine && (is_debug || dcheck_always_on)) {
# Enable SQLite's assert() macros.
defines += [ "SQLITE_DEBUG" ]
# Check preconditions when SQLite APIs are called. See # Check preconditions when SQLite APIs are called. See
# https://sqlite.org/compile.html#enable_api_armor # https://sqlite.org/compile.html#enable_api_armor
defines += [ "SQLITE_ENABLE_API_ARMOR" ] defines += [ "SQLITE_ENABLE_API_ARMOR" ]
...@@ -204,12 +207,18 @@ config("sqlite_warnings") { ...@@ -204,12 +207,18 @@ config("sqlite_warnings") {
# fts3EvalSelectDeferred sqlite3Fts3InitHashTable # fts3EvalSelectDeferred sqlite3Fts3InitHashTable
# sqlite3Fts3InitTok). # sqlite3Fts3InitTok).
cflags += [ "-Wno-unused-function" ] cflags += [ "-Wno-unused-function" ]
if (use_fuzzing_engine && (is_debug || dcheck_always_on)) {
cflags += [
"-Wno-implicit-function-declaration",
"-Wno-string-conversion"
]
}
} }
if (is_linux) { if (is_linux) {
cflags += [ cflags += [
# SQLite doesn"t believe in compiler warnings, # SQLite doesn't believe in compiler warnings, preferring testing.
# preferring testing. # http://www.sqlite.org/faq.html#q17
# http://www.sqlite.org/faq.html#q17
"-Wno-int-to-pointer-cast", "-Wno-int-to-pointer-cast",
"-Wno-pointer-to-int-cast", "-Wno-pointer-to-int-cast",
] ]
......
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