[PATCH] D126123: [analyzer][NFC] MemRegion::getRegion() never returns null

Balázs Benics via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sat May 21 12:21:27 PDT 2022


steakhal updated this revision to Diff 431168.
steakhal added reviewers: NoQ, martong.
steakhal added a comment.
Herald added a subscriber: rnkovacs.

Well, my first use of arc went a bit sideways, so I'm falling back to posting this NFC patch batch manually.
We will see how using arc works out next time.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D126123/new/

https://reviews.llvm.org/D126123

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


Index: clang/lib/StaticAnalyzer/Core/SVals.cpp
===================================================================
--- clang/lib/StaticAnalyzer/Core/SVals.cpp
+++ clang/lib/StaticAnalyzer/Core/SVals.cpp
@@ -177,8 +177,7 @@
 }
 
 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 {


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D126123.431168.patch
Type: text/x-patch
Size: 511 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20220521/ff397b09/attachment-0001.bin>


More information about the cfe-commits mailing list