diff --git a/infer/src/backend/InferPrint.re b/infer/src/backend/InferPrint.re index abc8a0f8e..0e3aa94be 100644 --- a/infer/src/backend/InferPrint.re +++ b/infer/src/backend/InferPrint.re @@ -272,7 +272,6 @@ let should_report (issue_kind: Exceptions.err_kind) issue_type error_desc eclass | Checkers | Eradicate | Tracing => true - | Bufferoverrun | Capture | Compile | Crashcontext diff --git a/infer/src/backend/infer.ml b/infer/src/backend/infer.ml index e7c240987..8f61ada15 100644 --- a/infer/src/backend/infer.ml +++ b/infer/src/backend/infer.ml @@ -375,7 +375,7 @@ let analyze driver_mode = false, false | _, (Capture | Compile) -> false, false - | _, (Infer | Eradicate | Checkers | Tracing | Crashcontext | Quandary | Bufferoverrun) -> + | _, (Infer | Eradicate | Checkers | Tracing | Crashcontext | Quandary) -> true, true | _, Linters -> false, true in diff --git a/infer/src/base/Config.ml b/infer/src/base/Config.ml index d67d96d55..461140ab1 100644 --- a/infer/src/base/Config.ml +++ b/infer/src/base/Config.ml @@ -37,7 +37,6 @@ let frontend_parse_modes = CLOpt.(Infer [Clang]) type analyzer = | Capture | Compile | Infer | Eradicate | Checkers | Tracing | Crashcontext | Linters | Quandary - | Bufferoverrun [@@deriving compare] let equal_analyzer = [%compare.equal : analyzer] @@ -46,7 +45,7 @@ let string_to_analyzer = [("capture", Capture); ("compile", Compile); ("infer", Infer); ("eradicate", Eradicate); ("checkers", Checkers); ("tracing", Tracing); ("crashcontext", Crashcontext); ("linters", Linters); - ("quandary", Quandary); ("bufferoverrun", Bufferoverrun)] + ("quandary", Quandary)] let string_of_analyzer a = List.find_exn ~f:(fun (_, a') -> equal_analyzer a a') string_to_analyzer |> fst @@ -482,11 +481,11 @@ and analyzer = (* NOTE: if compilation fails here, it means you have added a new analyzer without updating the documentation of this option *) | Capture | Compile | Infer | Eradicate | Checkers | Tracing | Crashcontext | Linters - | Quandary | Bufferoverrun -> () in + | Quandary -> () in CLOpt.mk_symbol_opt ~deprecated:["analyzer"] ~long:"analyzer" ~short:'a' ~parse_mode:CLOpt.(Infer [Driver]) "Specify which analyzer to run (only one at a time is supported):\n\ - - infer, eradicate, checkers, quandary, bufferoverrun: run the specified analysis\n\ + - infer, eradicate, checkers, quandary: run the specified analysis\n\ - capture: run capture phase only (no analysis)\n\ - compile: run compilation command without interfering (not supported by all frontends)\n\ - crashcontext, tracing: experimental (see --crashcontext and --tracing)\n\ @@ -558,6 +557,10 @@ and buck_out = CLOpt.mk_path_opt ~long:"buck-out" ~parse_mode:CLOpt.(Infer [Driver]) ~meta:"dir" "Specify the root directory of buck-out" +and bufferoverrun = + CLOpt.mk_bool ~long:"bufferoverrun" ~parse_mode:CLOpt.(Infer [Checkers]) + "Activate the buffer overrun analysis" + and bugs_csv = CLOpt.mk_path_opt ~deprecated:["bugs"] ~long:"issues-csv" ~parse_mode:CLOpt.(Infer [Driver;Print]) @@ -591,17 +594,12 @@ and changed_files_index = "Specify the file containing the list of source files from which reactive analysis should \ start. Source files should be specified relative to project root or be absolute" -and bufferoverrun, checkers, checkers_repeated_calls, +and checkers, checkers_repeated_calls, eradicate, quandary = let checkers = CLOpt.mk_bool ~deprecated:["checkers"] ~long:"checkers" "Activate the checkers instead of the full analysis" in - let bufferoverrun = - CLOpt.mk_bool_group ~long:"bufferoverrun" - "Activate the buffer overrun analysis" - [checkers] [] - in let checkers_repeated_calls = CLOpt.mk_bool_group ~long:"checkers-repeated-calls" "Check for repeated calls" @@ -617,7 +615,7 @@ and bufferoverrun, checkers, checkers_repeated_calls, "Activate the quandary taint analysis" [checkers] [] in - (bufferoverrun, checkers, checkers_repeated_calls, + (checkers, checkers_repeated_calls, eradicate, quandary) and clang_biniou_file = @@ -1554,7 +1552,6 @@ let post_parsing_initialization () = | Some Crashcontext -> checkers := true; crashcontext := true | Some Eradicate -> checkers := true; eradicate := true | Some Quandary -> checkers := true; quandary := true - | Some Bufferoverrun -> checkers := true; bufferoverrun := true | Some Tracing -> tracing := true | Some (Capture | Compile | Infer | Linters) | None -> () diff --git a/infer/src/base/Config.mli b/infer/src/base/Config.mli index 10a81b7e3..76b1daf06 100644 --- a/infer/src/base/Config.mli +++ b/infer/src/base/Config.mli @@ -20,7 +20,6 @@ val exe_name : exe -> string (** Various kind of analyzers *) type analyzer = | Capture | Compile | Infer | Eradicate | Checkers | Tracing | Crashcontext | Linters | Quandary - | Bufferoverrun [@@deriving compare] val equal_analyzer : analyzer -> analyzer -> bool diff --git a/infer/src/clang/ClangCommand.re b/infer/src/clang/ClangCommand.re index 4da779967..31f4b40a1 100644 --- a/infer/src/clang/ClangCommand.re +++ b/infer/src/clang/ClangCommand.re @@ -116,7 +116,7 @@ let clang_cc1_cmd_sanitizer cmd => { arg }; let args_defines = - if (Config.bufferoverrun || Config.equal_analyzer Config.analyzer Config.Bufferoverrun) { + if (Config.bufferoverrun) { ["-D__INFER_BUFFEROVERRUN"] } else { [] diff --git a/infer/src/integration/Buck.ml b/infer/src/integration/Buck.ml index 63d6b1921..c390bc7ec 100644 --- a/infer/src/integration/Buck.ml +++ b/infer/src/integration/Buck.ml @@ -51,7 +51,7 @@ let add_flavor_to_target target = target | None, (Linters | Capture) -> add "infer-capture-all" - | None, (Bufferoverrun | Checkers | Infer | Quandary) -> + | None, (Checkers | Infer | Quandary) -> add "infer" | None, (Eradicate | Tracing | Crashcontext) -> failwithf "Analyzer %s is Java-only; not supported with Buck flavors" diff --git a/infer/tests/codetoanalyze/c/bufferoverrun/Makefile b/infer/tests/codetoanalyze/c/bufferoverrun/Makefile index 358fffcaa..aeedafc44 100644 --- a/infer/tests/codetoanalyze/c/bufferoverrun/Makefile +++ b/infer/tests/codetoanalyze/c/bufferoverrun/Makefile @@ -10,9 +10,9 @@ TESTS_DIR = ../../.. -ANALYZER = bufferoverrun +ANALYZER = checkers CLANG_OPTIONS = -c -INFER_OPTIONS = -F --project-root $(TESTS_DIR) --no-failures-allowed +INFER_OPTIONS = --bufferoverrun -F --project-root $(TESTS_DIR) --no-failures-allowed INFERPRINT_OPTIONS = --issues-tests SOURCES = $(wildcard *.c) diff --git a/infer/tests/codetoanalyze/cpp/bufferoverrun/Makefile b/infer/tests/codetoanalyze/cpp/bufferoverrun/Makefile index cc6b815ca..69352c75f 100644 --- a/infer/tests/codetoanalyze/cpp/bufferoverrun/Makefile +++ b/infer/tests/codetoanalyze/cpp/bufferoverrun/Makefile @@ -7,10 +7,11 @@ TESTS_DIR = ../../.. -ANALYZER = bufferoverrun +ANALYZER = checkers # see explanations in cpp/errors/Makefile for the custom isystem CLANG_OPTIONS = -x c++ -std=c++11 -nostdinc++ -isystem$(MODELS_DIR)/cpp/include -isystem$(CLANG_INCLUDES)/c++/v1/ -c -INFER_OPTIONS = --ml-buckets cpp --no-filtering --debug-exceptions --project-root $(TESTS_DIR) --no-failures-allowed +INFER_OPTIONS = --bufferoverrun --ml-buckets cpp --no-filtering --debug-exceptions \ + --project-root $(TESTS_DIR) --no-failures-allowed INFERPRINT_OPTIONS = --issues-tests SOURCES = $(wildcard *.cpp)