From 7aa488a7fc5c3a8cd1a2b93476150e9737760713 Mon Sep 17 00:00:00 2001 From: Ted Kremenek Date: Mon, 16 May 2011 23:49:20 +0000 Subject: Fix crash on C++ code when compiling with -finstrument-functions. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131435 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/CodeGenFunction.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/CodeGen/CodeGenFunction.cpp') diff --git a/lib/CodeGen/CodeGenFunction.cpp b/lib/CodeGen/CodeGenFunction.cpp index 282b5e7eb5..28a4fa4bae 100644 --- a/lib/CodeGen/CodeGenFunction.cpp +++ b/lib/CodeGen/CodeGenFunction.cpp @@ -196,7 +196,7 @@ void CodeGenFunction::FinishFunction(SourceLocation EndLoc) { bool CodeGenFunction::ShouldInstrumentFunction() { if (!CGM.getCodeGenOpts().InstrumentFunctions) return false; - if (CurFuncDecl->hasAttr()) + if (!CurFuncDecl || CurFuncDecl->hasAttr()) return false; return true; } -- cgit v1.2.3