@@ -117,11 +117,11 @@ FUZZ_TARGET(versionbits, .init = initialize)
117
117
FuzzedDataProvider fuzzed_data_provider (buffer.data (), buffer.size ());
118
118
119
119
// making period/max_periods larger slows these tests down significantly
120
- const int period = 32 ;
120
+ const uint32_t period = 32 ;
121
121
const size_t max_periods = 16 ;
122
122
const size_t max_blocks = 2 * period * max_periods;
123
123
124
- const int threshold = fuzzed_data_provider.ConsumeIntegralInRange (1 , period);
124
+ const uint32_t threshold = fuzzed_data_provider.ConsumeIntegralInRange < uint32_t > (1 , period);
125
125
assert (0 < threshold && threshold <= period); // must be able to both pass and fail threshold!
126
126
127
127
// too many blocks at 10min each might cause uint32_t time to overflow if
@@ -199,7 +199,7 @@ FUZZ_TARGET(versionbits, .init = initialize)
199
199
while (fuzzed_data_provider.remaining_bytes () > 0 ) { // early exit; no need for LIMITED_WHILE
200
200
// all blocks in these periods either do or don't signal
201
201
bool signal = fuzzed_data_provider.ConsumeBool ();
202
- for (int b = 0 ; b < period; ++b) {
202
+ for (uint32_t b = 0 ; b < period; ++b) {
203
203
blocks.mine_block (signal);
204
204
}
205
205
@@ -211,7 +211,7 @@ FUZZ_TARGET(versionbits, .init = initialize)
211
211
// now we mine the final period and check that everything looks sane
212
212
213
213
// count the number of signalling blocks
214
- int blocks_sig = 0 ;
214
+ uint32_t blocks_sig = 0 ;
215
215
216
216
// get the info for the first block of the period
217
217
CBlockIndex* prev = blocks.tip ();
@@ -230,7 +230,7 @@ FUZZ_TARGET(versionbits, .init = initialize)
230
230
assert (exp_since <= prev_next_height);
231
231
232
232
// mine (period-1) blocks and check state
233
- for (int b = 1 ; b < period; ++b) {
233
+ for (uint32_t b = 1 ; b < period; ++b) {
234
234
const bool signal = (signalling_mask >> (b % 32 )) & 1 ;
235
235
if (signal) ++blocks_sig;
236
236
0 commit comments