clang 22.0.0git
UninitializedPointee.cpp File Reference
#include "UninitializedObject.h"
#include <optional>

Go to the source code of this file.

Classes

struct  DereferenceInfo

Functions

static std::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.
static bool isVoidPointer (QualType T)
 Returns whether T can be (transitively) dereferenced to a void pointer type (void*, void**, ...).

Function Documentation

◆ dereference()

std::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 std::nullopt.

Definition at line 217 of file UninitializedPointee.cpp.

References clang::ento::MemRegion::getAs(), clang::ento::FieldRegion::getDecl(), clang::ento::TypedValueRegion::getLocationType(), clang::Type::getPointeeType(), clang::ento::SubRegion::getSuperRegion(), clang::ValueDecl::getType(), clang::isa(), clang::ento::isDereferencableType(), isVoidPointer(), and V.

◆ isVoidPointer()

bool isVoidPointer ( QualType T)
static

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

Definition at line 270 of file UninitializedPointee.cpp.

References clang::T.

Referenced by dereference().