Skip to content

Commit

Permalink
Fix Not_found leaking from CFG to incremental comparison
Browse files Browse the repository at this point in the history
  • Loading branch information
sim642 committed Dec 1, 2022
1 parent 7527ff5 commit 8006212
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/framework/cfgTools.ml
Original file line number Diff line number Diff line change
Expand Up @@ -622,7 +622,8 @@ let getCFG (file: file) : cfg * cfg =
| Function fd -> fd
| FunctionEntry fd -> fd
in
(fun n -> H.find_default (fst @@ FH.find cfgs (find_fundec n)) n []), (fun n -> H.find_default (snd @@ FH.find cfgs (find_fundec n)) n [])
(* TODO: better Not_found handling *)
(fun n -> try H.find_default (fst @@ FH.find cfgs (find_fundec n)) n [] with Not_found -> []), (fun n -> try H.find_default (snd @@ FH.find cfgs (find_fundec n)) n [] with Not_found -> [])


let iter_fd_edges (module Cfg : CfgBackward) fd =
Expand Down
1 change: 1 addition & 0 deletions src/incremental/compareCIL.ml
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@ let compareCilFiles ?(eq=eq_glob) (oldAST: file) (newAST: file) =
| ForceReanalyze f ->
changes.exclude_from_rel_destab <- VarinfoSet.add f.svar changes.exclude_from_rel_destab;
append_to_changed ~unchangedHeader:false;
(* TODO: does this Not_found only concern old_global or also something in eq? *)
with Not_found -> changes.removed <- current_global::changes.removed (* Global could not be found in old map -> added *)
in

Expand Down

0 comments on commit 8006212

Please sign in to comment.