diff options
author | Ted Kremenek <kremenek@apple.com> | 2011-05-16 23:49:20 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2011-05-16 23:49:20 +0000 |
commit | 7aa488a7fc5c3a8cd1a2b93476150e9737760713 (patch) | |
tree | d7254f021fa1f64666baeb62b91a308f27147f76 /lib/CodeGen/CodeGenFunction.cpp | |
parent | 3217395e88e661e2a1c2b7eecb59629f67945b41 (diff) |
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
Diffstat (limited to 'lib/CodeGen/CodeGenFunction.cpp')
-rw-r--r-- | lib/CodeGen/CodeGenFunction.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
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<NoInstrumentFunctionAttr>()) + if (!CurFuncDecl || CurFuncDecl->hasAttr<NoInstrumentFunctionAttr>()) return false; return true; } |