]> granicus.if.org Git - jq/commitdiff
Add --enable-ubsan (undefined behavior sanitizer) 1081/head
authorNicolas Williams <nico@cryptonector.com>
Sun, 17 Jan 2016 18:09:43 +0000 (12:09 -0600)
committerNicolas Williams <nico@cryptonector.com>
Sun, 17 Jan 2016 19:06:27 +0000 (13:06 -0600)
Makefile.am
configure.ac

index 8a6ace42c90eb01c58bb9dabbac988a1df94925b..2a3aded4cd866a3208b99a182a1c615ee6e23783 100644 (file)
@@ -56,6 +56,10 @@ endif
 
 include_HEADERS = src/jv.h src/jq.h
 
+if ENABLE_UBSAN
+AM_CFLAGS += -fsanitize=undefined
+endif
+
 ### Running tests under Valgrind
 
 if ENABLE_ASAN
index 03aa71d25e257284e64e2f207dae1d3ce6926b73..4f640822bd40c104b93091a1b66460f856cc9257 100644 (file)
@@ -95,6 +95,10 @@ dnl faster.
 AC_ARG_ENABLE([asan],
    AC_HELP_STRING([--enable-asan], [enable address sanitizer]))
 
+dnl Undefined Behavior Sanitizer
+AC_ARG_ENABLE([ubsan],
+   AC_HELP_STRING([--enable-ubsan], [enable undefined behavior sanitizer]))
+
 dnl Code coverage
 AC_ARG_ENABLE([gcov],
    AC_HELP_STRING([--enable-gcov], [enable gcov code coverage tool]))
@@ -137,6 +141,7 @@ EOF
 
 AM_CONDITIONAL([ENABLE_VALGRIND], [test "x$enable_valgrind" != xno])
 AM_CONDITIONAL([ENABLE_ASAN], [test "x$enable_asan" = xyes])
+AM_CONDITIONAL([ENABLE_UBSAN], [test "x$enable_ubsan" = xyes])
 AM_CONDITIONAL([ENABLE_GCOV], [test "x$enable_gcov" = xyes])
 AM_CONDITIONAL([ENABLE_DOCS], [test "x$enable_docs" != xno])
 AM_CONDITIONAL([ENABLE_ERROR_INJECTION], [test "x$enable_error_injection" = xyes])