From 5a033e5db95f437131e7f7258ecc5925f6dcdca4 Mon Sep 17 00:00:00 2001 From: Michael Tautschnig Date: Wed, 11 Apr 2018 15:21:16 +0000 Subject: [PATCH 1/2] Reset hash_code upon irept::write Follow-up fix to b741d4b12. --- src/util/irep.h | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/util/irep.h b/src/util/irep.h index fbaf0ad5a94..59bac9cfef0 100644 --- a/src/util/irep.h +++ b/src/util/irep.h @@ -237,10 +237,16 @@ class irept dt &write(bool mark_shareable) { #ifdef SHARING - return data.write(mark_shareable); + dt &retval = data.write(mark_shareable); #else - return data; + dt &retval = data; +#endif + +#ifdef HASH_CODE + retval.hash_code = 0; #endif + + return retval; } public: From 46c286d6f9e462e98e1a6c7df5188edcf87276da Mon Sep 17 00:00:00 2001 From: Michael Tautschnig Date: Wed, 11 Apr 2018 15:24:31 +0000 Subject: [PATCH 2/2] Travis cron job with HASH_CODE enabled The existing regression tests would have uncovered the problem if only they had been used in this configuration. --- .travis.yml | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/.travis.yml b/.travis.yml index 52d548e3de2..e7ce4a174e6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -182,6 +182,35 @@ jobs: - CCACHE_CPP2=yes script: echo "Not running any tests for a debug build." + # Ubuntu Linux with glibc using g++-5 + - stage: Test different OS/CXX/Flags + os: linux + sudo: false + compiler: gcc + cache: ccache + addons: + apt: + sources: + - ubuntu-toolchain-r-test + packages: + - libwww-perl + - g++-5 + - libubsan0 + - parallel + before_install: + - | + if [[ "${TRAVIS_EVENT_TYPE}" != "cron" ]] + then + echo "This is not a cron build and build is not needed." + travis_terminate 0 + fi + - mkdir bin ; ln -s /usr/bin/gcc-5 bin/gcc + # env: COMPILER=g++-5 SAN_FLAGS="-fsanitize=undefined -fno-sanitize-recover -fno-omit-frame-pointer" + env: + - NAME="configuration HASH_CODE" + - COMPILER="ccache /usr/bin/g++-5" + - EXTRA_CXXFLAGS="-D_GLIBCXX_DEBUG -DHASH_CODE" + # cmake build using g++-5 - stage: Test different OS/CXX/Flags os: linux