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

Method create_list_fuzzer_var

src/program/transform.rs:800–916  ·  view source on GitHub ↗
(&mut self, ile: &InitListExpr, node: &Node)

Source from the content-addressed store, hash-verified

798 }
799
800 fn create_list_fuzzer_var(&mut self, ile: &InitListExpr, node: &Node) -> Result<()> {
801 let ty = ile.get_type().get_type_name();
802 let ty = InitListType::new(&ty);
803 match ty {
804 InitListType::CharList(row, col) => {
805 self.create_char_list_fuzzer_var(ile, node, row, col)?;
806 }
807 InitListType::CharStarList(row, _col) => {
808 let strings = ile.get_char_star_array_literal(node, Some(row))?;
809 for string in strings {
810 self.fuzzer_shim.append_string_var(string, "char");
811 }
812 }
813 InitListType::UCharList(row, col) => {
814 self.create_uchar_list_fuzzer_var(ile, node, row, col)?;
815 }
816 InitListType::UCharStarList(row, _col) => {
817 let strings = ile.get_char_star_array_literal(node, Some(row))?;
818 for string in strings {
819 self.fuzzer_shim.append_string_var(string, "unsigned char");
820 }
821 }
822 InitListType::FloatList(row, col) => {
823 self.create_float_list_fuzzer_var(ile, node, row, col)?;
824 }
825 InitListType::FloatStarList(row, _col) => {
826 let matrix = ile.get_floating_matrix_literal::<f32>(node, Some(row), None)?;
827 for literals in matrix {
828 self.fuzzer_shim.append_float_vars(literals);
829 }
830 }
831 InitListType::DoubleList(row, col) => {
832 self.create_double_list_fuzzer_var(ile, node, row, col)?
833 }
834 InitListType::DoubleStarList(row, _col) => {
835 let matrix = ile.get_floating_matrix_literal::<f64>(node, Some(row), None)?;
836 for literals in matrix {
837 self.fuzzer_shim.append_double_vars(literals);
838 }
839 }
840 InitListType::I8List(row, col) => {
841 self.create_int8_t_list_fuzzer_var(ile, node, row, col)?
842 }
843 InitListType::I8StarList(row, _col) => {
844 let matrix = ile.get_integer_matrix_literal::<i8>(node, Some(row), None)?;
845 for literals in matrix {
846 self.fuzzer_shim.append_integer_vars(literals);
847 }
848 }
849 InitListType::I16List(row, col) => {
850 self.create_int16_t_list_fuzzer_var(ile, node, row, col)?
851 }
852 InitListType::I16StarList(row, _col) => {
853 let matrix = ile.get_integer_matrix_literal::<i16>(node, Some(row), None)?;
854 for literals in matrix {
855 self.fuzzer_shim.append_integer_vars(literals);
856 }
857 }

Callers 1

Calls 7

get_type_nameMethod · 0.80
get_typeMethod · 0.80
append_string_varMethod · 0.80
append_float_varsMethod · 0.80
append_double_varsMethod · 0.80
append_integer_varsMethod · 0.80

Tested by

no test coverage detected