From e3c38c14e7dd9c115da960daafd109d2687f1a08 Mon Sep 17 00:00:00 2001 From: JF Bastien Date: Sun, 10 Jan 2016 10:49:59 -0800 Subject: Add Travis builds with sanitizers This triggers 5 independent build / test runs: - clang, no sanitizer; - clang, UB sanitizer; - clang, address sanitizer (disabled for now); - clang, thread sanitizer (disabled for now); - GCC. Enabling UBSan led to these changes: - Fix a bunch of undefined behavior throughout the code base. - Fix some tests that relied on that undefined behavior. - Make some of the tests easier to debug by printing their command line. - Add ubsan blacklist to work around libstdc++ bug. - Example testcase also needs sanitizer because libsupport.a uses it. --- src/wasm.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/wasm.h') diff --git a/src/wasm.h b/src/wasm.h index b1b8d84d4..c4654580a 100644 --- a/src/wasm.h +++ b/src/wasm.h @@ -45,13 +45,14 @@ #define wasm_wasm_h #include +#include #include #include #include #include #include -#include #include +#include #include "compiler-support.h" #include "emscripten-optimizer/simple_ast.h" @@ -200,7 +201,7 @@ struct Literal { } static void printDouble(std::ostream &o, double d) { - if (d == 0 && 1/d < 0) { + if (d == 0 && std::signbit(d)) { o << "-0"; return; } -- cgit v1.2.3