diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/CodeGen/CGDecl.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/CodeGen/CGDecl.cpp b/lib/CodeGen/CGDecl.cpp index c31840a78e..129416fa07 100644 --- a/lib/CodeGen/CGDecl.cpp +++ b/lib/CodeGen/CGDecl.cpp @@ -648,7 +648,8 @@ void CodeGenFunction::EmitAutoVarDecl(const VarDecl &D, // to this variable. Set it to zero to indicate that NRVO was not // applied. llvm::Value *Zero = Builder.getFalse(); - NRVOFlag = CreateTempAlloca(Zero->getType(), "nrvo"); + NRVOFlag = CreateTempAlloca(Zero->getType(), "nrvo"); + EnsureInsertPoint(); Builder.CreateStore(Zero, NRVOFlag); // Record the NRVO flag for this variable. |