[analyzer] Introduce the assume-controlled-environment config option
authorBalazs Benics <balazs.benics@sigmatechnology.se>
Wed, 13 Oct 2021 08:50:26 +0000 (10:50 +0200)
committerBalazs Benics <balazs.benics@sigmatechnology.se>
Wed, 13 Oct 2021 08:50:26 +0000 (10:50 +0200)
commitedde4efc66df2257f0b2351d5f98b4fbb2ced620
tree500cfa8e0c0a0a0b7390e90d915468f3afc265ad
parent7fc150309d27b0f98239bec758b895efda8c0481
[analyzer] Introduce the assume-controlled-environment config option

If the `assume-controlled-environment` is `true`, we should expect `getenv()`
to succeed, and the result should not be considered tainted.
By default, the option will be `false`.

Reviewed By: NoQ, martong

Differential Revision: https://reviews.llvm.org/D111296
clang/include/clang/StaticAnalyzer/Core/AnalyzerOptions.def
clang/lib/StaticAnalyzer/Checkers/GenericTaintChecker.cpp
clang/lib/StaticAnalyzer/Checkers/StdLibraryFunctionsChecker.cpp
clang/test/Analysis/analyzer-config.c
clang/test/Analysis/assume-controlled-environment.c [new file with mode: 0644]