diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2017-12-24 01:08:34 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2017-12-24 01:08:34 +0000 |
commit | 13ddaa8416c02b81fbab9357336f4e70624b7652 (patch) | |
tree | 7a0f6b255a547001b88203525cf7cd0e399acdf9 /contrib/llvm/tools/clang/lib/CodeGen/CodeGenModule.cpp | |
parent | da09e106efc76da569f2bad3d59b6b19b503bf39 (diff) | |
parent | 6252156da5066bd47f63f8bd40404d1f89909d32 (diff) |
Notes
Diffstat (limited to 'contrib/llvm/tools/clang/lib/CodeGen/CodeGenModule.cpp')
-rw-r--r-- | contrib/llvm/tools/clang/lib/CodeGen/CodeGenModule.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/contrib/llvm/tools/clang/lib/CodeGen/CodeGenModule.cpp b/contrib/llvm/tools/clang/lib/CodeGen/CodeGenModule.cpp index c59dc71da596..5bdf81aaf66e 100644 --- a/contrib/llvm/tools/clang/lib/CodeGen/CodeGenModule.cpp +++ b/contrib/llvm/tools/clang/lib/CodeGen/CodeGenModule.cpp @@ -103,6 +103,7 @@ CodeGenModule::CodeGenModule(ASTContext &C, const HeaderSearchOptions &HSO, Int16Ty = llvm::Type::getInt16Ty(LLVMContext); Int32Ty = llvm::Type::getInt32Ty(LLVMContext); Int64Ty = llvm::Type::getInt64Ty(LLVMContext); + HalfTy = llvm::Type::getHalfTy(LLVMContext); FloatTy = llvm::Type::getFloatTy(LLVMContext); DoubleTy = llvm::Type::getDoubleTy(LLVMContext); PointerWidthInBits = C.getTargetInfo().getPointerWidth(0); @@ -4289,7 +4290,11 @@ void CodeGenModule::ClearUnusedCoverageMapping(const Decl *D) { } void CodeGenModule::EmitDeferredUnusedCoverageMappings() { - for (const auto &Entry : DeferredEmptyCoverageMappingDecls) { + // We call takeVector() here to avoid use-after-free. + // FIXME: DeferredEmptyCoverageMappingDecls is getting mutated because + // we deserialize function bodies to emit coverage info for them, and that + // deserializes more declarations. How should we handle that case? + for (const auto &Entry : DeferredEmptyCoverageMappingDecls.takeVector()) { if (!Entry.second) continue; const Decl *D = Entry.first; |