File tree Expand file tree Collapse file tree 1 file changed +11
-6
lines changed
Expand file tree Collapse file tree 1 file changed +11
-6
lines changed Original file line number Diff line number Diff line change @@ -153,12 +153,17 @@ void cover_basic_blockst::add_block_lines(
153153 cover_basic_blockst::block_infot &block,
154154 const goto_programt::instructiont &instruction)
155155{
156- const irep_idt &line = instruction.source_location .get_line ();
157- if (!line.empty ())
158- {
159- block.lines .insert (unsafe_string2unsigned (id2string (line)));
160- block.source_lines .insert (instruction.source_location );
161- }
156+ const auto &add_location = [&](const source_locationt &location) {
157+ const irep_idt &line = location.get_line ();
158+ if (!line.empty ())
159+ {
160+ block.lines .insert (unsafe_string2unsigned (id2string (line)));
161+ block.source_lines .insert (location);
162+ }
163+ };
164+ add_location (instruction.source_location );
165+ instruction.code .visit_pre (
166+ [&](const exprt &expr) { add_location (expr.source_location ()); });
162167}
163168
164169void cover_basic_blockst::update_covered_lines (block_infot &block_info)
You can’t perform that action at this time.
0 commit comments