LLM is possible to assign a string argument with "input_file" name, so check whether this constraint is well inferred
(func: &str, constraints: Vec<Constraint>)
| 417 | |
| 418 | /// LLM is possible to assign a string argument with "input_file" name, so check whether this constraint is well inferred |
| 419 | fn refine_file_name_constraint(func: &str, constraints: Vec<Constraint>) -> Vec<Constraint> { |
| 420 | let mut retained = Vec::new(); |
| 421 | let deopt = Deopt::new(get_library_name()).unwrap(); |
| 422 | for constraint in constraints { |
| 423 | if let Constraint::FileName(arg_pos) = constraint { |
| 424 | if !check_func_arg_is_file_name(func, arg_pos, &deopt).unwrap() { |
| 425 | continue; |
| 426 | } |
| 427 | } |
| 428 | retained.push(constraint); |
| 429 | } |
| 430 | retained |
| 431 | } |
| 432 | |
| 433 | fn check_func_arg_is_file_name(func: &str, arg_pos: usize, deopt: &Deopt) -> Result<bool> { |
| 434 | let succ_seeds = deopt.get_library_succ_seed_dir()?; |
no test coverage detected