# HG changeset patch # User Chris Cannam # Date 1512653663 0 # Node ID 076aca59192fcc45a25f48815176cafa9ced4185 # Parent e4cf3ec069558794ce4310a86e6bb964eca0bbb0 Use undefined behaviour sanitiser in debug mode diff -r e4cf3ec06955 -r 076aca59192f configure --- a/configure Tue Dec 05 14:29:23 2017 +0000 +++ b/configure Thu Dec 07 13:34:23 2017 +0000 @@ -4425,9 +4425,10 @@ if test "x$GCC" = "xyes"; then CXXFLAGS_ANY="-std=c++11 -fpic -Wall -Wextra -Woverloaded-virtual -Wformat-nonliteral -Wformat-security -Winit-self -Wswitch-enum -Wconversion -pipe" - CXXFLAGS_DEBUG="$CXXFLAGS_ANY -g -Werror" + CXXFLAGS_DEBUG="$CXXFLAGS_ANY -g -Werror -fsanitize=undefined" CXXFLAGS_RELEASE="$CXXFLAGS_ANY -g0 -O3 -ffast-math" CXXFLAGS_MINIMAL="$CXXFLAGS_ANY -g0 -O0" + LIBS_DEBUG="$LIBS -lubsan" fi CXXFLAGS_BUILD="$CXXFLAGS_RELEASE" @@ -4441,6 +4442,7 @@ $as_echo "$as_me: enabling debug build" >&6;} QMAKE_CONFIG="debug" CXXFLAGS_BUILD="$CXXFLAGS_DEBUG" +LIBS="$LIBS_DEBUG" SV_DEFINES_BUILD="$SV_DEFINES_DEBUG" fi diff -r e4cf3ec06955 -r 076aca59192f configure.ac --- a/configure.ac Tue Dec 05 14:29:23 2017 +0000 +++ b/configure.ac Thu Dec 07 13:34:23 2017 +0000 @@ -54,9 +54,10 @@ if test "x$GCC" = "xyes"; then CXXFLAGS_ANY="-std=c++11 -fpic -Wall -Wextra -Woverloaded-virtual -Wformat-nonliteral -Wformat-security -Winit-self -Wswitch-enum -Wconversion -pipe" - CXXFLAGS_DEBUG="$CXXFLAGS_ANY -g -Werror" + CXXFLAGS_DEBUG="$CXXFLAGS_ANY -g -Werror -fsanitize=undefined" CXXFLAGS_RELEASE="$CXXFLAGS_ANY -g0 -O3 -ffast-math" CXXFLAGS_MINIMAL="$CXXFLAGS_ANY -g0 -O0" + LIBS_DEBUG="$LIBS -lubsan" fi CXXFLAGS_BUILD="$CXXFLAGS_RELEASE" @@ -67,7 +68,8 @@ AC_ARG_ENABLE(debug, [AS_HELP_STRING([--enable-debug],[enable debug support [default=no]])],[AC_MSG_NOTICE([enabling debug build]) QMAKE_CONFIG="debug" CXXFLAGS_BUILD="$CXXFLAGS_DEBUG" -SV_DEFINES_BUILD="$SV_DEFINES_DEBUG"]) +SV_DEFINES_BUILD="$SV_DEFINES_DEBUG" +LIBS="$LIBS_DEBUG"]) if test x"$USER_CXXFLAGS" != x; then AC_MSG_NOTICE([The CXXFLAGS environment variable is set to "$USER_CXXFLAGS".]) diff -r e4cf3ec06955 -r 076aca59192f main/MainWindow.cpp --- a/main/MainWindow.cpp Tue Dec 05 14:29:23 2017 +0000 +++ b/main/MainWindow.cpp Thu Dec 07 13:34:23 2017 +0000 @@ -4427,7 +4427,9 @@ SparseTimeValueModel *tvm = dynamic_cast(model); if (tvm) { - SparseTimeValueModel::Point point(frame, ev.getPitch() % 12, ""); + SparseTimeValueModel::Point point(frame, + float(ev.getPitch() % 12), + ""); SparseTimeValueModel::AddPointCommand *command = new SparseTimeValueModel::AddPointCommand (tvm, point, tr("Add Point")); diff -r e4cf3ec06955 -r 076aca59192f vext-lock.json --- a/vext-lock.json Tue Dec 05 14:29:23 2017 +0000 +++ b/vext-lock.json Thu Dec 07 13:34:23 2017 +0000 @@ -4,10 +4,10 @@ "pin": "a87e1bcce7b0" }, "svcore": { - "pin": "bd73a689c8af" + "pin": "9ae40c7aecdf" }, "svgui": { - "pin": "a9c2e791ab8d" + "pin": "5bab9562eaa3" }, "svapp": { "pin": "72b4870f0e6b"