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
diff --git a/lib/Analysis/GRExprEngine.cpp b/lib/Analysis/GRExprEngine.cpp
index 487b976..3f59ba6 100644
--- a/lib/Analysis/GRExprEngine.cpp
+++ b/lib/Analysis/GRExprEngine.cpp
@@ -209,7 +209,7 @@
// 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);