aboutsummaryrefslogtreecommitdiff
path: root/lib/StaticAnalyzer/Core/SymbolManager.cpp
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2012-08-23 06:16:52 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2012-08-23 06:16:52 +0000
commita8eaf008e92759142982f7b40720b2b2674bd663 (patch)
treefdbc6414d49262a6e3dbf2ecd383c3e1b311f9dc /lib/StaticAnalyzer/Core/SymbolManager.cpp
parent925d58c20aba52ef3901db7402a2067266ed12ea (diff)
Fix undefined behavior: member function calls where 'this' is a null pointer.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162430 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/StaticAnalyzer/Core/SymbolManager.cpp')
-rw-r--r--lib/StaticAnalyzer/Core/SymbolManager.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/StaticAnalyzer/Core/SymbolManager.cpp b/lib/StaticAnalyzer/Core/SymbolManager.cpp
index 440ddfffcd..c21df4c318 100644
--- a/lib/StaticAnalyzer/Core/SymbolManager.cpp
+++ b/lib/StaticAnalyzer/Core/SymbolManager.cpp
@@ -520,7 +520,7 @@ bool SymbolReaper::isLive(const VarRegion *VR, bool includeStoreBindings) const{
const StackFrameContext *CurrentContext = LCtx->getCurrentStackFrame();
if (VarContext == CurrentContext) {
- // If no statemetnt is provided, everything is live.
+ // If no statement is provided, everything is live.
if (!Loc)
return true;
@@ -548,7 +548,7 @@ bool SymbolReaper::isLive(const VarRegion *VR, bool includeStoreBindings) const{
return false;
}
- return VarContext->isParentOf(CurrentContext);
+ return !VarContext || VarContext->isParentOf(CurrentContext);
}
SymbolVisitor::~SymbolVisitor() {}