diff options
author | Ted Kremenek <kremenek@apple.com> | 2008-11-02 00:35:25 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2008-11-02 00:35:25 +0000 |
commit | de8cd19b64e4cf26dd6db4052ac0493f3870f043 (patch) | |
tree | ef1877c49b34bbf5b674d727c9a67f0ef361ad22 /lib/Analysis/GRExprEngineInternalChecks.cpp | |
parent | b3021339ad59d06402e15a9127b69203e45c9c9b (diff) |
Enhance return-of-stack-address checker to recognize regions created by alloca().
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58553 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/GRExprEngineInternalChecks.cpp')
-rw-r--r-- | lib/Analysis/GRExprEngineInternalChecks.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/Analysis/GRExprEngineInternalChecks.cpp b/lib/Analysis/GRExprEngineInternalChecks.cpp index d772744f17..cc5762267b 100644 --- a/lib/Analysis/GRExprEngineInternalChecks.cpp +++ b/lib/Analysis/GRExprEngineInternalChecks.cpp @@ -216,6 +216,15 @@ public: R = CL->getSourceRange(); } + else if (const AllocaRegion* AR = dyn_cast<AllocaRegion>(V.getRegion())) { + const Expr* ARE = AR->getExpr(); + SourceLocation L = ARE->getLocStart(); + R = ARE->getSourceRange(); + + os << "Address of stack memory allocated by call to alloca() on line " + << BR.getSourceManager().getLogicalLineNumber(L) + << " returned."; + } else { os << "Address of stack memory associated with local variable '" << V.getRegion()->getString() << "' returned."; |