aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/CodeGenFunction.cpp
diff options
context:
space:
mode:
authorAnders Carlsson <andersca@mac.com>2008-12-20 21:28:43 +0000
committerAnders Carlsson <andersca@mac.com>2008-12-20 21:28:43 +0000
commit751358ff73b155f5384e151e1d18aa3f6e7b061c (patch)
treec24787907721f455d85abefb8a09ba91a7e19b1b /lib/CodeGen/CodeGenFunction.cpp
parent4f5420d623831cceb567392067aa31ed2d3c37f6 (diff)
Make sure to generate code for arguments that have a variably modified type.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61288 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CodeGenFunction.cpp')
-rw-r--r--lib/CodeGen/CodeGenFunction.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/CodeGen/CodeGenFunction.cpp b/lib/CodeGen/CodeGenFunction.cpp
index 6f32553118..73b71b2f62 100644
--- a/lib/CodeGen/CodeGenFunction.cpp
+++ b/lib/CodeGen/CodeGenFunction.cpp
@@ -131,6 +131,16 @@ void CodeGenFunction::StartFunction(const Decl *D, QualType RetTy,
}
EmitFunctionProlog(CurFn, FnRetTy, Args);
+
+ // If any of the arguments have a variably modified type, make sure to
+ // emit the type size.
+ for (FunctionArgList::const_iterator i = Args.begin(), e = Args.end();
+ i != e; ++i) {
+ QualType Ty = i->second;
+
+ if (Ty->isVariablyModifiedType())
+ EmitVLASize(Ty);
+ }
}
void CodeGenFunction::GenerateCode(const FunctionDecl *FD,