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

subtle-encoding: Fix encode/decode in release builds #126

Merged
merged 1 commit into from Nov 25, 2018

Conversation

Projects
None yet
1 participant
@tony-iqlusion
Copy link
Contributor

tony-iqlusion commented Nov 25, 2018

The call to invoke the actual encoding/decoding functions was unintentionally gated on a debug_assert_eq!, and therefore was never invoked in release builds, resulting in all zeroes for encode/decode operations.

This change moves these invocations outside of the debug_assert_eq! statements so they are invoked in release builds.

subtle-encoding: Fix encode/decode in release builds
The call to invoke the actual encoding/decoding functions was
unintentionally gated on a `debug_assert_eq!`, and therefore was never
invoked in release builds, resulting in all zeroes for encode/decode
operations.

This change moves these invocations outside of the `debug_assert_eq!`
statements so they are invoked in release builds.
@tony-iqlusion

This comment has been minimized.

Copy link
Contributor

tony-iqlusion commented Nov 25, 2018

Sidebar: It might make sense to run all tests in release mode so as to catch bugs like this in the future.

I will take a look at doing that in a followup PR.

@tony-iqlusion tony-iqlusion merged commit 783eb59 into master Nov 25, 2018

2 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

@tony-iqlusion tony-iqlusion deleted the subtle-encoding/fix-release-builds branch Nov 25, 2018

tarcieri pushed a commit that referenced this pull request Nov 25, 2018

.travis.yml: Test all crates in release mode
This PR to subtle-encoding fixed a critical bug which only occurred in
release builds:

#126

Testing in release mode would've prevented it. This commit changes CI
tests to run in release mode to catch this sort of thing.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment