diff options
Diffstat (limited to 'lib/Transforms/Utils/ValueMapper.cpp')
| -rw-r--r-- | lib/Transforms/Utils/ValueMapper.cpp | 9 | 
1 files changed, 4 insertions, 5 deletions
| diff --git a/lib/Transforms/Utils/ValueMapper.cpp b/lib/Transforms/Utils/ValueMapper.cpp index 84d89f103a2fd..930972924c3c0 100644 --- a/lib/Transforms/Utils/ValueMapper.cpp +++ b/lib/Transforms/Utils/ValueMapper.cpp @@ -949,11 +949,10 @@ void Mapper::mapAppendingVariable(GlobalVariable &GV, Constant *InitPrefix,      Constant *NewV;      if (IsOldCtorDtor) {        auto *S = cast<ConstantStruct>(V); -      auto *E1 = mapValue(S->getOperand(0)); -      auto *E2 = mapValue(S->getOperand(1)); -      Value *Null = Constant::getNullValue(VoidPtrTy); -      NewV = -          ConstantStruct::get(cast<StructType>(EltTy), E1, E2, Null, nullptr); +      auto *E1 = cast<Constant>(mapValue(S->getOperand(0))); +      auto *E2 = cast<Constant>(mapValue(S->getOperand(1))); +      Constant *Null = Constant::getNullValue(VoidPtrTy); +      NewV = ConstantStruct::get(cast<StructType>(EltTy), E1, E2, Null);      } else {        NewV = cast_or_null<Constant>(mapValue(V));      } | 
