21 const std::string &file_name,
30 message.
error() <<
"taint file is not a valid json file"
38 message.
error() <<
"expecting an array in the taint file, but got "
48 message.
error() <<
"expecting an array of objects "
56 const std::string kind =
taint_spec[
"kind"].value;
62 else if(kind==
"sanitizer")
67 message.
error() <<
"taint rule must have \"kind\" which is "
68 "\"source\" or \"sink\" or \"sanitizer\""
73 const std::string function =
taint_spec[
"function"].value;
78 message.
error() <<
"taint rule must have \"function\""
83 rule.function_identifier=function;
85 const std::string where =
taint_spec[
"where"].value;
87 if(where==
"return_value")
95 else if(std::string(where, 0, 9)==
"parameter")
98 rule.parameter_number=
104 message.
error() <<
"taint rule must have \"where\""
105 <<
" which is \"return_value\" or \"this\" "
106 <<
"or \"parameter1\"..."
128 case SOURCE: out <<
"SOURCE ";
break;
129 case SINK: out <<
"SINK ";
break;
130 case SANITIZER: out <<
"SANITIZER ";
break;
133 out <<
taint <<
" on ";
virtual void output(const namespacet &ns, const irep_idt &function_id, const goto_programt &goto_program, std::ostream &out) const
Output the abstract states for a single function.
ait supplies three of the four components needed: an abstract interpreter (in this case handling func...
Class that provides messages with a built-in verbosity 'level'.
enum taint_parse_treet::rulet::@2 where
void output(std::ostream &) const
irep_idt function_identifier
enum taint_parse_treet::rulet::@1 kind
unsigned parameter_number
void output(std::ostream &) const
const std::string & id2string(const irep_idt &d)
json_arrayt & to_json_array(jsont &json)
bool parse_json(std::istream &in, const std::string &filename, message_handlert &message_handler, jsont &dest)
static void json(json_objectT &result, const irep_idt &property_id, const property_infot &property_info)
unsigned safe_string2unsigned(const std::string &str, int base)
bool taint_parser(const std::string &file_name, taint_parse_treet &dest, message_handlert &message_handler)