diff --git a/infer/src/base/Config.ml b/infer/src/base/Config.ml index 09a258c2b..2d270cbe2 100644 --- a/infer/src/base/Config.ml +++ b/infer/src/base/Config.ml @@ -922,6 +922,10 @@ and flavors = "Buck integration using Buck flavors (clang only), eg $(i,`infer --flavors -- buck build \ //foo:bar#infer`)" +and fragment_retains_view = + CLOpt.mk_bool ~long:"fragment-retains-view" ~in_help:CLOpt.[Analyze, manual_generic] + "detects when Android fragments are not explicitly nullified before becoming unreabable" + and from_json_report = CLOpt.mk_path_opt ~long:"from-json-report" ~in_help:CLOpt.[Report, manual_generic] @@ -1719,6 +1723,7 @@ and filter_paths = !filter_paths and filter_report_paths = !filter_report_paths and filtering = !filtering and flavors = !flavors +and fragment_retains_view = !fragment_retains_view and from_json_report = !from_json_report and frontend_debug = !frontend_debug and frontend_stats = !frontend_stats diff --git a/infer/src/base/Config.mli b/infer/src/base/Config.mli index 1b2dfeb88..82ff9312b 100644 --- a/infer/src/base/Config.mli +++ b/infer/src/base/Config.mli @@ -235,6 +235,7 @@ val filter_paths : bool val filter_report_paths : string option val filtering : bool val flavors : bool +val fragment_retains_view : bool val from_json_report : string option val frontend_debug : bool val frontend_tests : bool diff --git a/infer/src/checkers/registerCheckers.ml b/infer/src/checkers/registerCheckers.ml index 289230eaa..a797425c2 100644 --- a/infer/src/checkers/registerCheckers.ml +++ b/infer/src/checkers/registerCheckers.ml @@ -26,7 +26,8 @@ let active_procedure_checkers () = let java_checkers = let l = [ - FragmentRetainsViewChecker.callback_fragment_retains_view, enabled_by_default; + FragmentRetainsViewChecker.callback_fragment_retains_view, enabled_by_default + || Config.fragment_retains_view; Eradicate.callback_eradicate, Config.eradicate; BoundedCallTree.checker, Config.crashcontext; JavaTaintAnalysis.checker, Config.quandary || enabled_by_default;