From b8310eae2e419d6a806f3ffc34ec6d163e1a755c Mon Sep 17 00:00:00 2001 From: Zhongxing Xu Date: Fri, 21 Aug 2009 03:05:36 +0000 Subject: 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 --- lib/Analysis/GRExprEngine.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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(&StateMgr.getCodeDecl())) + if (const FunctionDecl *FD = dyn_cast(InitLoc->getDecl())) if (strcmp(FD->getIdentifier()->getName(), "main") == 0 && FD->getNumParams() > 0) { const ParmVarDecl *PD = FD->getParamDecl(0); -- cgit v1.2.3