@@ -39,7 +39,7 @@ class taint_analysist
39
39
const symbol_tablet &,
40
40
goto_functionst &,
41
41
bool show_full,
42
- const std::string &json_file_name);
42
+ const optionalt< std::string> &json_file_name);
43
43
44
44
protected:
45
45
messaget log;
@@ -224,12 +224,12 @@ bool taint_analysist::operator()(
224
224
const symbol_tablet &symbol_table,
225
225
goto_functionst &goto_functions,
226
226
bool show_full,
227
- const std::string &json_file_name)
227
+ const optionalt< std::string> &json_file_name)
228
228
{
229
229
try
230
230
{
231
231
json_arrayt json_result;
232
- bool use_json=! json_file_name.empty ();
232
+ bool use_json = json_file_name.has_value ();
233
233
234
234
log.status () << " Reading taint file `" << taint_file_name << " '"
235
235
<< messaget::eom;
@@ -378,17 +378,17 @@ bool taint_analysist::operator()(
378
378
379
379
if (use_json)
380
380
{
381
- std::ofstream json_out (json_file_name);
381
+ std::ofstream json_out (json_file_name. value () );
382
382
383
383
if (!json_out)
384
384
{
385
- log.error () << " Failed to open json output `" << json_file_name << " ' "
386
- << messaget::eom;
385
+ log.error () << " Failed to open json output `" << json_file_name. value ()
386
+ << " ' " << messaget::eom;
387
387
return true ;
388
388
}
389
389
390
- log.status () << " Analysis result is written to `" << json_file_name << " ' "
391
- << messaget::eom;
390
+ log.status () << " Analysis result is written to `"
391
+ << json_file_name. value () << " ' " << messaget::eom;
392
392
393
393
json_out << json_result << ' \n ' ;
394
394
}
@@ -418,7 +418,7 @@ bool taint_analysis(
418
418
const std::string &taint_file_name,
419
419
message_handlert &message_handler,
420
420
bool show_full,
421
- const std::string &json_file_name)
421
+ const optionalt< std::string> &json_file_name)
422
422
{
423
423
taint_analysist taint_analysis (message_handler);
424
424
return taint_analysis (
0 commit comments