Skip to content

Commit

Permalink
Initialize pointers with nullptr.
Browse files Browse the repository at this point in the history
  • Loading branch information
PetroZarytskyi committed Nov 21, 2023
1 parent 58d3136 commit 2c37889
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/Differentiator/TBRAnalyzer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ TBRAnalyzer::VarData::VarData(const QualType QT) {
} else if (utils::isArrayOrPointerType(QT)) {
type = VarData::ARR_TYPE;
val.m_ArrData = std::unique_ptr<ArrMap>(new ArrMap());
const Type* elemType;
const Type* elemType = nullptr;
if (const auto* const pointerType = llvm::dyn_cast<clang::PointerType>(QT))
elemType = pointerType->getPointeeType().getTypePtrOrNull();
else
Expand All @@ -217,7 +217,7 @@ TBRAnalyzer::VarData::VarData(const QualType QT) {
void TBRAnalyzer::overlay(const clang::Expr* E) {
m_NonConstIndexFound = false;
llvm::SmallVector<ProfileID, 2> IDSequence;
const clang::DeclRefExpr* innermostDRE;
const clang::DeclRefExpr* innermostDRE = nullptr;
bool cond = true;
/// Unwrap the given expression to a vector of indices and fields.
while (cond) {
Expand Down

0 comments on commit 2c37889

Please sign in to comment.