Resolve a bug that Infer does not analyze procedures when the analyzer is run on '/'.

Summary:Resolve a bug that Infer does not analyze procedures when the analyzer is run on '/'.
This bug is reported by btakeya on facebook/infer#283.
Closes https://github.com/facebook/infer/pull/284

Reviewed By: cristianoc

Differential Revision: D2960328

Pulled By: jvillard

fb-gh-sync-id: 55e8b0c
shipit-source-id: 55e8b0c
master
kstreee 9 years ago committed by facebook-github-bot-1
parent 7cb4165189
commit a7e004472d

@ -51,9 +51,9 @@ let abs_source_file_from_path fname =
(** convert a project root directory and a full path to a rooted source file *)
let rel_source_file_from_abs_path root fname =
if Utils.string_is_prefix root fname then
let relative_fname = filename_to_relative root fname in
Relative relative_fname
let relative_complemented_fname = filename_to_relative root fname in
if Utils.string_is_prefix root fname && Filename.is_relative relative_complemented_fname then
Relative relative_complemented_fname
else
(* The project root is not a prefix of the file name *)
abs_source_file_from_path fname

Loading…
Cancel
Save