Skip to content

Commit 0be9840

Browse files
committed
Merge #185: cmake: Enable additional security checks for MSVC
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
2 parents 30b681f + c06c03e commit 0be9840

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,7 @@ if(WIN32)
236236
/utf-8
237237
/Zc:preprocessor
238238
/Zc:__cplusplus
239+
/sdl
239240
)
240241
# Improve parallelism in MSBuild.
241242
# See: https://devblogs.microsoft.com/cppblog/improved-parallelism-in-msbuild/.

src/test/validation_chainstate_tests.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
#include <test/util/random.h>
1313
#include <test/util/setup_common.h>
1414
#include <uint256.h>
15+
#include <util/check.h>
1516
#include <validation.h>
1617

1718
#include <vector>
@@ -102,14 +103,14 @@ BOOST_FIXTURE_TEST_CASE(chainstate_update_tip, TestChain100Setup)
102103

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

105-
Chainstate& background_cs{*[&] {
106+
Chainstate& background_cs{*Assert([&]() -> Chainstate* {
106107
for (Chainstate* cs : chainman.GetAll()) {
107108
if (cs != &chainman.ActiveChainstate()) {
108109
return cs;
109110
}
110111
}
111-
assert(false);
112-
}()};
112+
return nullptr;
113+
}())};
113114

114115
// Append the first block to the background chain.
115116
BlockValidationState state;

0 commit comments

Comments
 (0)