From 2c378895fb62684cd1d4354239a42826e78912fd Mon Sep 17 00:00:00 2001 From: "petro.zarytskyi" Date: Tue, 21 Nov 2023 14:01:22 +0200 Subject: [PATCH] Initialize pointers with nullptr. --- lib/Differentiator/TBRAnalyzer.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/Differentiator/TBRAnalyzer.cpp b/lib/Differentiator/TBRAnalyzer.cpp index d1433e4ab..d9c226540 100644 --- a/lib/Differentiator/TBRAnalyzer.cpp +++ b/lib/Differentiator/TBRAnalyzer.cpp @@ -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(new ArrMap()); - const Type* elemType; + const Type* elemType = nullptr; if (const auto* const pointerType = llvm::dyn_cast(QT)) elemType = pointerType->getPointeeType().getTypePtrOrNull(); else @@ -217,7 +217,7 @@ TBRAnalyzer::VarData::VarData(const QualType QT) { void TBRAnalyzer::overlay(const clang::Expr* E) { m_NonConstIndexFound = false; llvm::SmallVector 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) {