diff options
author | Johannes Altmanninger <aclopte@gmail.com> | 2019-11-15 02:12:58 +0100 |
---|---|---|
committer | Johannes Altmanninger <aclopte@gmail.com> | 2019-11-28 00:59:25 +0100 |
commit | 1ac700cdef787383ad49a0e37d9894491ef19480 (patch) | |
tree | 859c5a902238bdce94b59f87a9e3bfafdd8957dc /clang/lib/CodeGen/CGExprAgg.cpp | |
parent | 5272d2a3a43b21dadb61a8320c14df94db89acc1 (diff) | |
download | bcm5719-llvm-1ac700cdef787383ad49a0e37d9894491ef19480.tar.gz bcm5719-llvm-1ac700cdef787383ad49a0e37d9894491ef19480.zip |
[CodeGen] Fix clang crash on aggregate initialization of array of labels
Summary: Fix PR43700
The ConstantEmitter in AggExprEmitter::EmitArrayInit was initialized
with the CodeGenFunction set to null, which caused the crash.
Also simplify another call, and make the CGF member a const pointer
since it is public but only assigned in the constructor.
Subscribers: cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D70302
Diffstat (limited to 'clang/lib/CodeGen/CGExprAgg.cpp')
-rw-r--r-- | clang/lib/CodeGen/CGExprAgg.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/CGExprAgg.cpp b/clang/lib/CodeGen/CGExprAgg.cpp index 7e69f63fe13..ecb5253c07e 100644 --- a/clang/lib/CodeGen/CGExprAgg.cpp +++ b/clang/lib/CodeGen/CGExprAgg.cpp @@ -493,7 +493,7 @@ void AggExprEmitter::EmitArrayInit(Address DestPtr, llvm::ArrayType *AType, if (NumInitElements * elementSize.getQuantity() > 16 && elementType.isTriviallyCopyableType(CGF.getContext())) { CodeGen::CodeGenModule &CGM = CGF.CGM; - ConstantEmitter Emitter(CGM); + ConstantEmitter Emitter(CGF); LangAS AS = ArrayQTy.getAddressSpace(); if (llvm::Constant *C = Emitter.tryEmitForInitializer(E, AS, ArrayQTy)) { auto GV = new llvm::GlobalVariable( |