aboutsummaryrefslogtreecommitdiff
path: root/lib/AST/Decl.cpp
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2010-04-13 22:18:28 +0000
committerJohn McCall <rjmccall@apple.com>2010-04-13 22:18:28 +0000
commit21c0160959961b3a6ab3308608ee3fde182ecb49 (patch)
tree7d096b22cb7ff0f6197ff87cd090dcbf5814e2a8 /lib/AST/Decl.cpp
parentab970f90ce31a53fe7e6375a37536bf0832fd922 (diff)
Fix an embarrasing memory error. I was apparently very tired when I wrote this
code the first time. Fixes PR6827. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101184 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/Decl.cpp')
-rw-r--r--lib/AST/Decl.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/AST/Decl.cpp b/lib/AST/Decl.cpp
index 965f32da28..d4cc945b1b 100644
--- a/lib/AST/Decl.cpp
+++ b/lib/AST/Decl.cpp
@@ -1316,7 +1316,7 @@ FunctionDecl::setDependentTemplateSpecialization(ASTContext &Context,
assert(TemplateOrSpecialization.isNull());
size_t Size = sizeof(DependentFunctionTemplateSpecializationInfo);
Size += Templates.size() * sizeof(FunctionTemplateDecl*);
- Size += TemplateArgs.size();
+ Size += TemplateArgs.size() * sizeof(TemplateArgumentLoc);
void *Buffer = Context.Allocate(Size);
DependentFunctionTemplateSpecializationInfo *Info =
new (Buffer) DependentFunctionTemplateSpecializationInfo(Templates,