[inferconfig] don't fail during filtering if a file does not exist

master
Cristiano Calcagno 10 years ago
parent 442a15e9fa
commit 9c4a4a16f3

@ -95,11 +95,13 @@ module FileContainsStringMatcher = struct
try try
DB.SourceFileMap.find source_file !source_map DB.SourceFileMap.find source_file !source_map
with Not_found -> with Not_found ->
try
let file_in = open_in (DB.source_file_to_string source_file) in let file_in = open_in (DB.source_file_to_string source_file) in
let pattern_found = file_contains regexp file_in in let pattern_found = file_contains regexp file_in in
close_in file_in; close_in file_in;
source_map := DB.SourceFileMap.add source_file pattern_found !source_map; source_map := DB.SourceFileMap.add source_file pattern_found !source_map;
pattern_found pattern_found
with Sys_error _ -> false
end end
let filters_from_inferconfig inferconfig : filters = let filters_from_inferconfig inferconfig : filters =

Loading…
Cancel
Save