diff options
Diffstat (limited to 'lldb/source/Expression/IRForTarget.cpp')
-rw-r--r-- | lldb/source/Expression/IRForTarget.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/lldb/source/Expression/IRForTarget.cpp b/lldb/source/Expression/IRForTarget.cpp index 711943401db..dc27b65548e 100644 --- a/lldb/source/Expression/IRForTarget.cpp +++ b/lldb/source/Expression/IRForTarget.cpp @@ -2210,7 +2210,8 @@ IRForTarget::UnfoldConstant(Constant *old_constant, llvm::cast<Instruction>(entry_instruction_finder.GetValue(function))); }); - return UnfoldConstant(constant_expr, bit_cast_maker, entry_instruction_finder); + if (!UnfoldConstant(constant_expr, bit_cast_maker, entry_instruction_finder)) + return false; } break; case Instruction::GetElementPtr: @@ -2247,7 +2248,8 @@ IRForTarget::UnfoldConstant(Constant *old_constant, return GetElementPtrInst::Create(ptr, indices, "", llvm::cast<Instruction>(entry_instruction_finder.GetValue(function))); }); - return UnfoldConstant(constant_expr, get_element_pointer_maker, entry_instruction_finder); + if (!UnfoldConstant(constant_expr, get_element_pointer_maker, entry_instruction_finder)) + return false; } break; } @@ -2274,6 +2276,11 @@ IRForTarget::UnfoldConstant(Constant *old_constant, } } + if (!isa<GlobalValue>(old_constant)) + { + old_constant->destroyConstant(); + } + return true; } |