diff options
| author | Brian Campbell | 2020-11-21 21:29:44 +0000 |
|---|---|---|
| committer | Brian Campbell | 2020-11-21 21:29:44 +0000 |
| commit | c6670a94ab654d819b94683b3c7a0627f1d939df (patch) | |
| tree | e5b7cd60ee9b02871e170abc0285eb90f551733d /src/jib/jib_compile.ml | |
| parent | c5d27227d8d5832dcd2011d2826359df4bc47e0e (diff) | |
Make coverage support look a little harder for location information
Diffstat (limited to 'src/jib/jib_compile.ml')
| -rw-r--r-- | src/jib/jib_compile.ml | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/jib/jib_compile.ml b/src/jib/jib_compile.ml index 93071f69..8b886d14 100644 --- a/src/jib/jib_compile.ml +++ b/src/jib/jib_compile.ml @@ -226,11 +226,19 @@ let append_into_block instrs instr = | [] -> instr | _ -> iblock (instrs @ [instr]) -let coverage_branch_taken branch_id (AE_aux (_, _, l)) = +let rec find_aexp_loc (AE_aux (e, _, l)) = + match Reporting.simp_loc l with + | Some _ -> l + | None -> + match e with + | AE_cast (e',_) -> find_aexp_loc e' + | _ -> l + +let coverage_branch_taken branch_id aexp = match C.branch_coverage with | None -> [] | Some out -> begin - match coverage_loc_args l with + match coverage_loc_args (find_aexp_loc aexp) with | None -> [] | Some args -> Printf.fprintf out "%s\n" ("B " ^ args); |
