Skip to content

Commit d95e8f4

Browse files
authored
Merge pull request diffblue#339 from diffblue/bugfix/dump_plots_only_when_explicitly_requested
SEC-16: Taint slicer: Dump of call graph SVGs under only when HTML dump is on.
2 parents d1a6fee + 7d68e89 commit d95e8f4

File tree

2 files changed

+12
-10
lines changed

2 files changed

+12
-10
lines changed

src/taint-analysis/taint_security_scanner.cpp

+12-3
Original file line numberDiff line numberDiff line change
@@ -183,10 +183,10 @@ bool taint_do_security_scan(
183183

184184
if(config.is_html_dump_of_program_slice_enabled())
185185
{
186+
const boost::filesystem::path results_dir =
187+
config.get_slicer_root_directory();
186188
const std::string svg_path =
187-
(boost::filesystem::path(config.get_slicer_root_directory()) /
188-
"tokens_propagation_graph.svg")
189-
.native();
189+
(results_dir / "tokens_propagation_graph.svg").native();
190190

191191
logger.status()
192192
<< "Saving tokens propagation graph (see '"
@@ -195,6 +195,15 @@ bool taint_do_security_scan(
195195
taint_dump_as_svg(
196196
*tokens_propagation_graph_ptr,
197197
svg_path);
198+
199+
logger.status() << "Saving call graph." << messaget::eom;
200+
dump_callgraph_in_svg(
201+
program.get_call_graph(),
202+
(results_dir / "call_graph.svg").native());
203+
logger.status() << "Saving inverted call graph." << messaget::eom;
204+
dump_callgraph_in_svg(
205+
program.get_inverted_call_graph(),
206+
(results_dir / "inverted_call_graph.svg").native());
198207
}
199208

200209
if(config.is_html_dump_of_summaries_enabled())

src/taint-slicer/slicer.cpp

-7
Original file line numberDiff line numberDiff line change
@@ -130,11 +130,4 @@ void taint_slicert::compute_slice(
130130
(results_dir / "instrumented_goto_programs.json").native());
131131
ostr << jtasks;
132132
}
133-
134-
dump_callgraph_in_svg(
135-
program->get_call_graph(),
136-
(results_dir / "call_graph.svg").native());
137-
dump_callgraph_in_svg(
138-
program->get_inverted_call_graph(),
139-
(results_dir / "inverted_call_graph.svg").native());
140133
}

0 commit comments

Comments
 (0)