From a7e004472de9cd4430bd30e085908bc0c4f3a109 Mon Sep 17 00:00:00 2001 From: kstreee Date: Mon, 22 Feb 2016 09:01:29 -0800 Subject: [PATCH] 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 --- infer/src/backend/DB.ml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/infer/src/backend/DB.ml b/infer/src/backend/DB.ml index 21f11f3ff..d7cc42b1d 100644 --- a/infer/src/backend/DB.ml +++ b/infer/src/backend/DB.ml @@ -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