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

Method create_unlimit_list_fuzzer_var

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

Source from the content-addressed store, hash-verified

916 }
917
918 fn create_unlimit_list_fuzzer_var(&mut self, ile: &InitListExpr, node: &Node) -> Result<()> {
919 let ty = ile.get_type().get_type_name();
920 let ty = InitListType::new(&ty);
921 match ty {
922 InitListType::CharList(row, _) => {
923 self.create_unlimit_char_list_fuzzer_var(ile, node, row)?;
924 }
925 InitListType::CharStarList(row, _col) => {
926 let strings = ile.get_char_star_array_literal(node, Some(row))?;
927 for string in strings {
928 self.fuzzer_shim.append_string_var(string, "char");
929 }
930 }
931 InitListType::UCharList(row, _) => {
932 self.create_unlimit_uchar_list_fuzzer_var(ile, node, row)?;
933 }
934 InitListType::UCharStarList(row, _col) => {
935 let strings = ile.get_char_star_array_literal(node, Some(row))?;
936 for string in strings {
937 self.fuzzer_shim.append_string_var(string, "unsigned char");
938 }
939 }
940 InitListType::FloatList(row, _) => {
941 self.create_unlimit_float_list_fuzzer_var(ile, node, row)?;
942 }
943 InitListType::FloatStarList(row, _col) => {
944 let matrix = ile.get_floating_matrix_literal::<f32>(node, Some(row), None)?;
945 for literals in matrix {
946 self.fuzzer_shim.append_float_vars(literals);
947 }
948 }
949 InitListType::DoubleList(row, _) => {
950 self.create_unlimit_double_list_fuzzer_var(ile, node, row)?
951 }
952 InitListType::DoubleStarList(row, _col) => {
953 let matrix = ile.get_floating_matrix_literal::<f64>(node, Some(row), None)?;
954 for literals in matrix {
955 self.fuzzer_shim.append_double_vars(literals);
956 }
957 }
958 InitListType::I8List(row, _) => {
959 self.create_unlimit_int8_t_list_fuzzer_var(ile, node, row)?
960 }
961 InitListType::I8StarList(row, _col) => {
962 let matrix = ile.get_integer_matrix_literal::<i8>(node, Some(row), None)?;
963 for literals in matrix {
964 self.fuzzer_shim.append_integer_vars(literals);
965 }
966 }
967 InitListType::I16List(row, _) => {
968 self.create_unlimit_int16_t_list_fuzzer_var(ile, node, row)?
969 }
970 InitListType::I16StarList(row, _col) => {
971 let matrix = ile.get_integer_matrix_literal::<i16>(node, Some(row), None)?;
972 for literals in matrix {
973 self.fuzzer_shim.append_integer_vars(literals);
974 }
975 }

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