Get the code decl from the initial location context.

llvm-svn: 79591
diff --git a/clang/lib/Analysis/GRExprEngine.cpp b/clang/lib/Analysis/GRExprEngine.cpp
index 487b976..3f59ba6 100644
--- a/clang/lib/Analysis/GRExprEngine.cpp
+++ b/clang/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);