diff options
author | Richard Trieu <rtrieu@google.com> | 2014-06-09 22:53:25 +0000 |
---|---|---|
committer | Richard Trieu <rtrieu@google.com> | 2014-06-09 22:53:25 +0000 |
commit | ddd01cec0e4ecec0ca2f6e02c38281ee562fcd8d (patch) | |
tree | 37c95111a4e9ec687e3be04eb7f4e149d693c0e2 /clang/lib/StaticAnalyzer/Core/MemRegion.cpp | |
parent | a23043cb9c1ef021a9cf05cd62cce76cd03c0ba2 (diff) | |
download | bcm5719-llvm-ddd01cec0e4ecec0ca2f6e02c38281ee562fcd8d.tar.gz bcm5719-llvm-ddd01cec0e4ecec0ca2f6e02c38281ee562fcd8d.zip |
Removing an "if (this == nullptr)" check from two print methods. The condition
will never be true in a well-defined context. The checking for null pointers
has been moved into the caller logic so it does not rely on undefined behavior.
llvm-svn: 210498
Diffstat (limited to 'clang/lib/StaticAnalyzer/Core/MemRegion.cpp')
-rw-r--r-- | clang/lib/StaticAnalyzer/Core/MemRegion.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/clang/lib/StaticAnalyzer/Core/MemRegion.cpp b/clang/lib/StaticAnalyzer/Core/MemRegion.cpp index 12bbfdf62d2..22711f54239 100644 --- a/clang/lib/StaticAnalyzer/Core/MemRegion.cpp +++ b/clang/lib/StaticAnalyzer/Core/MemRegion.cpp @@ -508,10 +508,12 @@ void ObjCIvarRegion::dumpToStream(raw_ostream &os) const { } void StringRegion::dumpToStream(raw_ostream &os) const { + assert(Str != nullptr && "Expecting non-null StringLiteral"); Str->printPretty(os, nullptr, PrintingPolicy(getContext().getLangOpts())); } void ObjCStringRegion::dumpToStream(raw_ostream &os) const { + assert(Str != nullptr && "Expecting non-null ObjCStringLiteral"); Str->printPretty(os, nullptr, PrintingPolicy(getContext().getLangOpts())); } |