MCPcopy Create free account
hub / github.com/FuzzAnything/PromptFuzz / append_integer_array

Method append_integer_array

src/program/shim.rs:235–249  ·  view source on GitHub ↗
(&mut self, integers: Vec<T>)

Source from the content-addressed store, hash-verified

233 }
234
235 pub fn append_integer_array<T: Integer>(&mut self, integers: Vec<T>) {
236 let ty_name = std::any::type_name::<T>();
237 let binding = get_rust_to_c_map();
238 let c_ty_name = binding
239 .get(ty_name)
240 .unwrap_or_else(|| panic!("cannot found {ty_name} from RUST_TO_C_MAP."));
241
242 let var = format!("FDPConsumeIntegralArray({c_ty_name}, fuzz_{c_ty_name}_array_{0}, fuzz_{c_ty_name}_array_size_{0}, fdp);", self.get_fuzz_id_inc());
243 self.fuzz_stmts.push(var);
244 let mut bytes: Vec<u8> = Vec::new();
245 for integer in integers {
246 bytes.extend(integer.to_bytes());
247 }
248 self.append_fuzz_seeds_with_magic(&bytes);
249 }
250
251 pub fn append_fuzzer_stmt(&mut self, stmt: String) {
252 self.fuzz_stmts.push(stmt);

Callers

nothing calls this directly

Calls 3

get_rust_to_c_mapFunction · 0.85
pushMethod · 0.45

Tested by

no test coverage detected