Merge remote-tracking branch 'origin/topic/timw/disable-object-size-at-O0'

* origin/topic/timw/disable-object-size-at-O0:
  Disable object-size analysis if optimization set to -O0
This commit is contained in:
Tim Wojtulewicz 2022-04-14 08:59:34 -07:00
commit 5bd360966c
3 changed files with 12 additions and 2 deletions

View file

@ -1,3 +1,7 @@
5.0.0-dev.248 | 2022-04-14 08:59:34 -0700
* Disable object-size analysis if optimization set to -O0 (Tim Wojtulewicz, Corelight)
5.0.0-dev.246 | 2022-04-14 10:48:19 +0200
* Allow analyzer violations to explicitly set tag. (Robin Sommer, Corelight)

View file

@ -178,7 +178,6 @@ if ( ZEEK_SANITIZERS )
# list(APPEND _check_list "nullability-assign") # Not normally part of "undefined"
# list(APPEND _check_list "nullability-return") # Not normally part of "undefined"
# list(APPEND _check_list "objc-cast") # Not truly UB
list(APPEND _check_list "object-size")
# list(APPEND _check_list "pointer-overflow") # Not implemented in older GCCs
list(APPEND _check_list "return")
list(APPEND _check_list "returns-nonnull-attribute")
@ -190,6 +189,13 @@ if ( ZEEK_SANITIZERS )
list(APPEND _check_list "vla-bound")
# list(APPEND _check_list "vptr") # TODO: fix associated errors
# Clang complains if this one is defined and the optimizer is set to -O0. We
# only set that optimization level if NO_OPTIMIZATIONS is passed, so disable
# the option if that's set.
if ( NOT DEFINED ENV{NO_OPTIMIZATIONS} )
list(APPEND _check_list "object-size")
endif ()
string(REPLACE ";" "," _ub_checks "${_check_list}")
set(ZEEK_SANITIZER_UB_CHECKS "${_ub_checks}" CACHE INTERNAL "" FORCE)
else ()

View file

@ -1 +1 @@
5.0.0-dev.246
5.0.0-dev.248