[clang] 3a666dd - [analyzer][NFC] Use MemRegion::getRegion()'s return value unconditionally

Balazs Benics via cfe-commits cfe-commits at lists.llvm.org
Fri May 27 01:08:03 PDT 2022


Author: Balazs Benics
Date: 2022-05-27T10:07:06+02:00
New Revision: 3a666dd37a06fd5ff74b9e8fea15e31a80398233

URL: https://github.com/llvm/llvm-project/commit/3a666dd37a06fd5ff74b9e8fea15e31a80398233
DIFF: https://github.com/llvm/llvm-project/commit/3a666dd37a06fd5ff74b9e8fea15e31a80398233.diff

LOG: [analyzer][NFC] Use MemRegion::getRegion()'s return value unconditionally

Reviewed By: martong

Differential Revision: https://reviews.llvm.org/D126123

Added: 
    

Modified: 
    clang/lib/StaticAnalyzer/Core/SVals.cpp

Removed: 
    


################################################################################
diff  --git a/clang/lib/StaticAnalyzer/Core/SVals.cpp b/clang/lib/StaticAnalyzer/Core/SVals.cpp
index 963861c136c3..1429d36107e9 100644
--- a/clang/lib/StaticAnalyzer/Core/SVals.cpp
+++ b/clang/lib/StaticAnalyzer/Core/SVals.cpp
@@ -177,8 +177,7 @@ QualType SVal::getType(const ASTContext &Context) const {
 }
 
 const MemRegion *loc::MemRegionVal::stripCasts(bool StripBaseCasts) const {
-  const MemRegion *R = getRegion();
-  return R ?  R->StripCasts(StripBaseCasts) : nullptr;
+  return getRegion()->StripCasts(StripBaseCasts);
 }
 
 const void *nonloc::LazyCompoundVal::getStore() const {


        


More information about the cfe-commits mailing list