#include "clang/StaticAnalyzer/Checkers/BuiltinCheckerRegistration.h"
#include "clang/StaticAnalyzer/Core/PathSensitive/CallEvent.h"
#include "clang/StaticAnalyzer/Core/PathSensitive/CheckerContext.h"
#include "clang/StaticAnalyzer/Core/PathSensitive/CheckerHelpers.h"
#include "clang/StaticAnalyzer/Core/PathSensitive/ProgramState.h"
#include "clang/StaticAnalyzer/Core/PathSensitive/ProgramStateTrait.h"
#include "clang/StaticAnalyzer/Core/PathSensitive/SymbolManager.h"
#include "clang/StaticAnalyzer/Core/BugReporter/BugType.h"
#include "clang/StaticAnalyzer/Core/Checker.h"
#include "clang/StaticAnalyzer/Core/CheckerManager.h"
#include "clang/AST/ParentMap.h"
#include <optional>
usingnamespaceclang;
usingnamespaceento;
namespace {
class VforkChecker : public Checker<check::PreCall, check::PostCall,
check::Bind, check::PreStmt<ReturnStmt>> { … };
}
REGISTER_TRAIT_WITH_PROGRAMSTATE(…) …
#define VFORK_RESULT_INVALID …
#define VFORK_RESULT_NONE …
bool VforkChecker::isChildProcess(const ProgramStateRef State) { … }
bool VforkChecker::isVforkCall(const Decl *D, CheckerContext &C) const { … }
bool VforkChecker::isCallExplicitelyAllowed(const IdentifierInfo *II,
CheckerContext &C) const { … }
void VforkChecker::reportBug(const char *What, CheckerContext &C,
const char *Details) const { … }
void VforkChecker::checkPostCall(const CallEvent &Call,
CheckerContext &C) const { … }
void VforkChecker::checkPreCall(const CallEvent &Call,
CheckerContext &C) const { … }
void VforkChecker::checkBind(SVal L, SVal V, const Stmt *S,
CheckerContext &C) const { … }
void VforkChecker::checkPreStmt(const ReturnStmt *RS, CheckerContext &C) const { … }
void ento::registerVforkChecker(CheckerManager &mgr) { … }
bool ento::shouldRegisterVforkChecker(const CheckerManager &mgr) { … }