json: turn off ubsan for json_variant_has_type()

Fixes: #15907
This commit is contained in:
Lennart Poettering
2020-05-26 09:01:26 +02:00
parent 6028d766d1
commit 8e2fa6e223
2 changed files with 12 additions and 1 deletions
+8
View File
@@ -84,6 +84,14 @@
#define _variable_no_sanitize_address_
#endif
/* Apparently there's no has_feature() call defined to check for ubsan, hence let's define this
* unconditionally on llvm */
#if defined(__clang__)
#define _function_no_sanitize_float_cast_overflow_ __attribute__((no_sanitize("float-cast-overflow")))
#else
#define _function_no_sanitize_float_cast_overflow_
#endif
/* Temporarily disable some warnings */
#define DISABLE_WARNING_FORMAT_NONLITERAL \
_Pragma("GCC diagnostic push"); \