MCPcopy Create free account
hub / github.com/MultiFuzz/MultiFuzz / replace_input

Method replace_input

hail-fuzz/src/queue.rs:197–209  ·  view source on GitHub ↗

Replace an input in the input corpus with a new version.

(&mut self, id: InputId, state: &State)

Source from the content-addressed store, hash-verified

195
196 /// Replace an input in the input corpus with a new version.
197 pub fn replace_input(&mut self, id: InputId, state: &State) {
198 self.remove_global_metadata(id);
199 self.add_to_global_metadata(id, state);
200
201 let entry = &mut self.test_cases[id];
202 entry.data.clone_from(&state.input);
203 entry.metadata.untrimed_len = entry.metadata.len;
204 entry.metadata.len = state.input.total_bytes() as u64;
205 entry.metadata.streams = entry.data.count_non_empty_streams() as u64;
206 entry.metadata.instructions = state.instructions;
207
208 self.replaced.push(id);
209 }
210
211 pub fn add(&mut self, state: &State) -> InputId {
212 let id = self.add_data(state.input.clone());

Callers 1

runMethod · 0.80

Calls 5

clone_fromMethod · 0.80
total_bytesMethod · 0.80

Tested by

no test coverage detected