Skip to content

Commit

Permalink
Merge #185: cmake: Enable additional security checks for MSVC
Browse files Browse the repository at this point in the history
c06c03e fixup! cmake: Add platform-specific definitions and properties (Hennadii Stepanov)
08b98f0 refactor, test: Always initialize pointer (Hennadii Stepanov)

Pull request description:

  Same as on the master branch: https://github.com/hebasto/bitcoin/blob/99d7538cdb2a0ab7a7a2116cd5f33b95fc52b00e/build_msvc/common.init.vcxproj.in#L64

  The first commit has been pulled from bitcoin#30026.

Top commit has no ACKs.

Tree-SHA512: c81848f9064d0f59640c0d50839637b528268e2e206e521887258fa1a4b8b1e419475e7285d0318d43375684da85afabccc32fb747d1251a529e3d8cc966965a
  • Loading branch information
hebasto committed May 4, 2024
2 parents 30b681f + c06c03e commit 0be9840
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,7 @@ if(WIN32)
/utf-8
/Zc:preprocessor
/Zc:__cplusplus
/sdl
)
# Improve parallelism in MSBuild.
# See: https://devblogs.microsoft.com/cppblog/improved-parallelism-in-msbuild/.
Expand Down
7 changes: 4 additions & 3 deletions src/test/validation_chainstate_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#include <test/util/random.h>
#include <test/util/setup_common.h>
#include <uint256.h>
#include <util/check.h>
#include <validation.h>

#include <vector>
Expand Down Expand Up @@ -102,14 +103,14 @@ BOOST_FIXTURE_TEST_CASE(chainstate_update_tip, TestChain100Setup)

BOOST_CHECK_EQUAL(chainman.GetAll().size(), 2);

Chainstate& background_cs{*[&] {
Chainstate& background_cs{*Assert([&]() -> Chainstate* {
for (Chainstate* cs : chainman.GetAll()) {
if (cs != &chainman.ActiveChainstate()) {
return cs;
}
}
assert(false);
}()};
return nullptr;
}())};

// Append the first block to the background chain.
BlockValidationState state;
Expand Down

0 comments on commit 0be9840

Please sign in to comment.