[cfe-commits] r132089 - /cfe/trunk/lib/Sema/SemaTemplateInstantiateDecl.cpp
Sean Hunt
scshunt at csclub.uwaterloo.ca
Wed May 25 15:02:25 PDT 2011
Author: coppro
Date: Wed May 25 17:02:25 2011
New Revision: 132089
URL: http://llvm.org/viewvc/llvm-project?rev=132089&view=rev
Log:
Fix a minor thinko that leads to a crash if PatternDecl is null but
Pattern is not. Thanks Nick for catching this!
Modified:
cfe/trunk/lib/Sema/SemaTemplateInstantiateDecl.cpp
Modified: cfe/trunk/lib/Sema/SemaTemplateInstantiateDecl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaTemplateInstantiateDecl.cpp?rev=132089&r1=132088&r2=132089&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaTemplateInstantiateDecl.cpp (original)
+++ cfe/trunk/lib/Sema/SemaTemplateInstantiateDecl.cpp Wed May 25 17:02:25 2011
@@ -2318,11 +2318,12 @@
// Find the function body that we'll be substituting.
const FunctionDecl *PatternDecl = Function->getTemplateInstantiationPattern();
Stmt *Pattern = 0;
- if (PatternDecl)
+ if (PatternDecl) {
Pattern = PatternDecl->getBody(PatternDecl);
- if (!Pattern)
- // Try to find a defaulted definition
- PatternDecl->isDefined(PatternDecl);
+ if (!Pattern)
+ // Try to find a defaulted definition
+ PatternDecl->isDefined(PatternDecl);
+ }
// Postpone late parsed template instantiations.
if (PatternDecl && PatternDecl->isLateTemplateParsed() &&
More information about the cfe-commits
mailing list