Skip to content

Commit

Permalink
count with exception handlers as separated branches for branch counti…
Browse files Browse the repository at this point in the history
…ng too
  • Loading branch information
okbob committed Dec 31, 2021
1 parent d7b6e1c commit e7d0531
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/profiler.c
Original file line number Diff line number Diff line change
Expand Up @@ -1137,6 +1137,10 @@ profiler_stmt_walker(profiler_info *pinfo,

if (stmt_block->exceptions)
{
if (collect_coverage_mode)
increment_branch_counter(opts->cs,
opts->nested_exec_count);

foreach(lc, stmt_block->exceptions->exc_list)
{
stmts = ((PLpgSQL_exception *) lfirst(lc))->action;
Expand All @@ -1149,6 +1153,9 @@ profiler_stmt_walker(profiler_info *pinfo,

if (count_exec_time_mode)
nested_us_time += opts->nested_us_time;
else if (collect_coverage_mode)
increment_branch_counter(opts->cs,
opts->nested_exec_count);
}
}
}
Expand Down

0 comments on commit e7d0531

Please sign in to comment.