Add the size_t constriant for the fuzzer input.
(&mut self, size_stmt: &str)
| 461 | |
| 462 | /// Add the size_t constriant for the fuzzer input. |
| 463 | pub fn add_fuzzer_size_constraint(&mut self, size_stmt: &str) -> Result<()> { |
| 464 | let visitor = self.get_new_visitor()?; |
| 465 | let ins_loc = visitor.get_function_body_begin_loc()?; |
| 466 | let constraint = format!( |
| 467 | "\n\tif({size_stmt}<{}) return 0;\n", |
| 468 | self.fuzzer_shim.get_offset() |
| 469 | ); |
| 470 | self.seek_and_rewrite(ins_loc, 0, &constraint)?; |
| 471 | Ok(()) |
| 472 | } |
| 473 | |
| 474 | fn write_fuzzer_vars_stmts(&mut self) -> Result<()> { |
| 475 | let fuzzer_stmts = self.fuzzer_shim.serialize_fuzzer_stmts(); |
no test coverage detected