clang  10.0.0svn
Classes | Functions
UninitializedPointee.cpp File Reference
#include "UninitializedObject.h"
#include "clang/StaticAnalyzer/Core/BugReporter/BugType.h"
#include "clang/StaticAnalyzer/Core/Checker.h"
#include "clang/StaticAnalyzer/Core/PathSensitive/CheckerContext.h"
#include "clang/StaticAnalyzer/Core/PathSensitive/DynamicType.h"
Include dependency graph for UninitializedPointee.cpp:

Go to the source code of this file.

Classes

struct  DereferenceInfo
 

Functions

static llvm::Optional< DereferenceInfodereference (ProgramStateRef State, const FieldRegion *FR)
 Dereferences FR and returns with the pointee's region, and whether it needs to be casted back to it's location type. More...
 
static bool isVoidPointer (QualType T)
 Returns whether T can be (transitively) dereferenced to a void pointer type (void*, void**, ...). More...
 

Function Documentation

◆ dereference()

static llvm::Optional< DereferenceInfo > dereference ( ProgramStateRef  State,
const FieldRegion FR 
)
static

Dereferences FR and returns with the pointee's region, and whether it needs to be casted back to it's location type.

If for whatever reason dereferencing fails, returns with None.

Definition at line 222 of file UninitializedPointee.cpp.

References clang::ento::SVal::getAs(), clang::ento::MemRegion::getAs(), clang::Type::getAs(), clang::ento::SVal::getAsRegion(), clang::ento::FieldRegion::getDecl(), clang::Type::getPointeeType(), clang::ValueDecl::getType(), clang::ento::isDereferencableType(), isVoidPointer(), and V.

Referenced by DereferenceInfo::DereferenceInfo(), and clang::interp::ByteCodeExprGen< Emitter >::VisitCastExpr().

◆ isVoidPointer()

static bool isVoidPointer ( QualType  T)
static

Returns whether T can be (transitively) dereferenced to a void pointer type (void*, void**, ...).

Definition at line 275 of file UninitializedPointee.cpp.

References clang::Type::getPointeeType(), clang::QualType::isNull(), and clang::Type::isVoidPointerType().

Referenced by dereference(), and DereferenceInfo::DereferenceInfo().