Skip to content

Repair HASH_CODE support and enable it in Travis #2044

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 8 additions & 2 deletions src/util/irep.h
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down