From bf605b264403eb197217c02fc84b03a48b3000a2 Mon Sep 17 00:00:00 2001 From: Jack Grigg Date: Tue, 24 Apr 2018 23:04:09 +0100 Subject: [PATCH] Return result of boost::apply_visitor Not returning a value at the end of a non-void function is undefined behaviour. Given that this managed to pass our full test suite, I guess that GCC looks for un-returned values at the end of a function and uses them as the return value, if the keyword is missing. Clang OTOH complains, which is how we spotted this: https://ci.z.cash/#/builders/16/builds/282 --- src/primitives/transaction.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/primitives/transaction.cpp b/src/primitives/transaction.cpp index 4f61b24ea..9bcc0e8a0 100644 --- a/src/primitives/transaction.cpp +++ b/src/primitives/transaction.cpp @@ -115,7 +115,7 @@ bool JSDescription::Verify( const uint256& pubKeyHash ) const { auto pv = SproutProofVerifier(params, verifier, pubKeyHash, *this); - boost::apply_visitor(pv, proof); + return boost::apply_visitor(pv, proof); } uint256 JSDescription::h_sig(ZCJoinSplit& params, const uint256& pubKeyHash) const