llvm/clang/lib/StaticAnalyzer/Checkers/UndefinedNewArraySizeChecker.cpp

//===--- UndefinedNewArraySizeChecker.cpp -----------------------*- C++ -*--==//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
//
// This defines UndefinedNewArraySizeChecker, a builtin check in ExprEngine
// that checks if the size of the array in a new[] expression is undefined.
//
//===----------------------------------------------------------------------===//

#include "clang/StaticAnalyzer/Checkers/BuiltinCheckerRegistration.h"
#include "clang/StaticAnalyzer/Core/BugReporter/BugType.h"
#include "clang/StaticAnalyzer/Core/Checker.h"
#include "clang/StaticAnalyzer/Core/CheckerManager.h"
#include "clang/StaticAnalyzer/Core/PathSensitive/CallEvent.h"
#include "clang/StaticAnalyzer/Core/PathSensitive/CheckerContext.h"

usingnamespaceclang;
usingnamespaceento;

namespace {
class UndefinedNewArraySizeChecker : public Checker<check::PreCall> {};
} // namespace

void UndefinedNewArraySizeChecker::checkPreCall(const CallEvent &Call,
                                                CheckerContext &C) const {}

void UndefinedNewArraySizeChecker::HandleUndefinedArrayElementCount(
    CheckerContext &C, SVal ArgVal, const Expr *Init, SourceRange Range) const {}

void ento::registerUndefinedNewArraySizeChecker(CheckerManager &mgr) {}

bool ento::shouldRegisterUndefinedNewArraySizeChecker(
    const CheckerManager &mgr) {}