summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZhongxing Xu <xuzhongxing@gmail.com>2009-08-21 03:05:36 +0000
committerZhongxing Xu <xuzhongxing@gmail.com>2009-08-21 03:05:36 +0000
commitb8310eae2e419d6a806f3ffc34ec6d163e1a755c (patch)
tree435f9d15626fd35d694a118f6f16bf71256d95b8
parenteda95463235ce5aca012e08e8468fe3ac85cbd43 (diff)
Get the code decl from the initial location context.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79591 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/Analysis/GRExprEngine.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/Analysis/GRExprEngine.cpp b/lib/Analysis/GRExprEngine.cpp
index 487b9764ce..3f59ba6524 100644
--- a/lib/Analysis/GRExprEngine.cpp
+++ b/lib/Analysis/GRExprEngine.cpp
@@ -209,7 +209,7 @@ const GRState* GRExprEngine::getInitialState(const LocationContext *InitLoc) {
// to be > 0.
// FIXME: It would be nice if we had a more general mechanism to add
// such preconditions. Some day.
- if (const FunctionDecl *FD = dyn_cast<FunctionDecl>(&StateMgr.getCodeDecl()))
+ if (const FunctionDecl *FD = dyn_cast<FunctionDecl>(InitLoc->getDecl()))
if (strcmp(FD->getIdentifier()->getName(), "main") == 0 &&
FD->getNumParams() > 0) {
const ParmVarDecl *PD = FD->getParamDecl(0);