mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-04-09 12:50:18 +02:00
Merge bitcoin/bitcoin#26272: test: Prevent UB in minisketch_tests.cpp
97007e2b9b7a578315df2b1549cd6075130e8f05 test: Prevent UB in `minisketch_tests.cpp` (Hennadii Stepanov) Pull request description: [`std::optional::operator*`](https://en.cppreference.com/w/cpp/utility/optional/operator*), which follows after the changed line, can cause UB. This PR addresses https://github.com/bitcoin/bitcoin/issues/26262#issuecomment-1268855418 ACKs for top commit: stickies-v: ACK 97007e2b9b7a578315df2b1549cd6075130e8f05 Tree-SHA512: a7dde8dac0cbdfa362fa1158b4564eccff9405852612227d581690c9a34084b3467ae6d4c0269262688d75339dcea90aaa38fccbba9be92d2643c2113860f3d6
This commit is contained in:
commit
73b61717a9
@ -40,7 +40,7 @@ BOOST_AUTO_TEST_CASE(minisketch_test)
|
||||
Minisketch sketch_c = std::move(sketch_ar);
|
||||
sketch_c.Merge(sketch_br);
|
||||
auto dec = sketch_c.Decode(errors);
|
||||
BOOST_CHECK(dec.has_value());
|
||||
BOOST_REQUIRE(dec.has_value());
|
||||
auto sols = std::move(*dec);
|
||||
std::sort(sols.begin(), sols.end());
|
||||
for (uint32_t i = 0; i < a_not_b; ++i) BOOST_CHECK_EQUAL(sols[i], start_a + i);
|
||||
|
Loading…
x
Reference in New Issue
Block a user