changeset 1754:076aca59192f

Use undefined behaviour sanitiser in debug mode
author Chris Cannam
date Thu, 07 Dec 2017 13:34:23 +0000
parents e4cf3ec06955
children c866f9a77b23
files configure configure.ac main/MainWindow.cpp vext-lock.json
diffstat 4 files changed, 12 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- 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
 
--- 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".])
--- 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<SparseTimeValueModel *>(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"));
--- 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"