diff --git a/infer/src/clang/ClangWrapper.re b/infer/src/clang/ClangWrapper.re index 8fdbba0e8..8380f5a59 100644 --- a/infer/src/clang/ClangWrapper.re +++ b/infer/src/clang/ClangWrapper.re @@ -112,6 +112,8 @@ let execute_clang_command (clang_cmd: ClangCommand.t) => { }; let exe args xx_suffix => { + /* make sure args.(0) points to clang in facebook-clang-plugins */ + args.(0) = CFrontend_config.clang_bin xx_suffix; let commands = normalize args; /* xcodebuild projects may require the object files to be generated by the Apple compiler, eg to generate precompiled headers compatible with Apple's clang. */ diff --git a/infer/src/clang/InferClang.re b/infer/src/clang/InferClang.re index 597e44084..144e122e0 100644 --- a/infer/src/clang/InferClang.re +++ b/infer/src/clang/InferClang.re @@ -11,7 +11,5 @@ open! Utils; let () = { let xx_suffix = string_is_suffix "++" Sys.argv.(0) ? "++" : ""; let args = Array.copy Sys.argv; - /* make sure we don't call ourselves recursively */ - args.(0) = CFrontend_config.clang_bin xx_suffix; ClangWrapper.exe args xx_suffix };