mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-02-02 09:46:52 -05:00
Make lifetime correctness easier to see (avoid reference lifetime extension)
This commit is contained in:
parent
e7ddbd9893
commit
e37f53648e
3 changed files with 3 additions and 3 deletions
|
@ -27,7 +27,7 @@ void test_one_input(const std::vector<uint8_t>& buffer)
|
|||
while (fuzzed_data_provider.remaining_bytes() > 0) {
|
||||
switch (fuzzed_data_provider.ConsumeIntegralInRange(0, 6)) {
|
||||
case 0: {
|
||||
const std::vector<unsigned char>& b = ConsumeRandomLengthByteVector(fuzzed_data_provider);
|
||||
const std::vector<unsigned char> b = ConsumeRandomLengthByteVector(fuzzed_data_provider);
|
||||
(void)bloom_filter.contains(b);
|
||||
bloom_filter.insert(b);
|
||||
const bool present = bloom_filter.contains(b);
|
||||
|
|
|
@ -24,7 +24,7 @@ void test_one_input(const std::vector<uint8_t>& buffer)
|
|||
while (fuzzed_data_provider.remaining_bytes() > 0) {
|
||||
switch (fuzzed_data_provider.ConsumeIntegralInRange(0, 2)) {
|
||||
case 0: {
|
||||
const std::vector<unsigned char>& b = ConsumeRandomLengthByteVector(fuzzed_data_provider);
|
||||
const std::vector<unsigned char> b = ConsumeRandomLengthByteVector(fuzzed_data_provider);
|
||||
(void)rolling_bloom_filter.contains(b);
|
||||
rolling_bloom_filter.insert(b);
|
||||
const bool present = rolling_bloom_filter.contains(b);
|
||||
|
|
|
@ -27,7 +27,7 @@ NODISCARD inline std::vector<uint8_t> ConsumeRandomLengthByteVector(FuzzedDataPr
|
|||
template <typename T>
|
||||
NODISCARD inline Optional<T> ConsumeDeserializable(FuzzedDataProvider& fuzzed_data_provider, size_t max_length = 4096) noexcept
|
||||
{
|
||||
const std::vector<uint8_t>& buffer = ConsumeRandomLengthByteVector(fuzzed_data_provider, max_length);
|
||||
const std::vector<uint8_t> buffer = ConsumeRandomLengthByteVector(fuzzed_data_provider, max_length);
|
||||
CDataStream ds{buffer, SER_NETWORK, INIT_PROTO_VERSION};
|
||||
T obj;
|
||||
try {
|
||||
|
|
Loading…
Add table
Reference in a new issue