diff options
Diffstat (limited to 'lib/CodeGen/CodeGenFunction.cpp')
-rw-r--r-- | lib/CodeGen/CodeGenFunction.cpp | 10 |
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, |