Skip to content

Commit 64b00b5

Browse files
committed
Fix self.initialize() for AlternationMutator
For the case where one of the submutators recurs to the alternation mutator itself.
1 parent bd5d499 commit 64b00b5

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

fuzzcheck/src/mutators/alternation.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ where
5050
added_complexity,
5151
initialized: Cell::new(false),
5252
min_complexity: Cell::new(std::f64::INFINITY),
53-
max_complexity: Cell::default(),
54-
search_space_complexity: Cell::default(),
53+
max_complexity: Cell::new(std::f64::INFINITY),
54+
search_space_complexity: Cell::new(std::f64::INFINITY),
5555
_phantom: PhantomData,
5656
}
5757
}
@@ -165,9 +165,14 @@ where
165165
|x1, x2| x1.partial_cmp(x2).unwrap_or(Ordering::Equal),
166166
)
167167
.unwrap();
168+
168169
self.min_complexity.set(min_complexity);
169170
self.max_complexity.set(max_complexity);
170171
self.search_space_complexity.set(search_space_complexity);
172+
173+
for mutator in self.mutators.iter() {
174+
mutator.initialize();
175+
}
171176
self.initialized.set(true);
172177
}
173178

0 commit comments

Comments
 (0)