[llvm] r364611 - Fix ASAN error caused by commit r364512.
Rumeet Dhindsa via llvm-commits
llvm-commits at lists.llvm.org
Thu Jun 27 16:37:04 PDT 2019
Author: rdhindsa
Date: Thu Jun 27 16:37:04 2019
New Revision: 364611
URL: http://llvm.org/viewvc/llvm-project?rev=364611&view=rev
Log:
Fix ASAN error caused by commit r364512.
This patch intends to fix ASAN stack-use-after-scope error.
This is at least a short-term fix to unbreak LLVM's mainline.
Differential Revision: https://reviews.llvm.org/D63905
Modified:
llvm/trunk/lib/CodeGen/GlobalISel/IRTranslator.cpp
Modified: llvm/trunk/lib/CodeGen/GlobalISel/IRTranslator.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/GlobalISel/IRTranslator.cpp?rev=364611&r1=364610&r2=364611&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/GlobalISel/IRTranslator.cpp (original)
+++ llvm/trunk/lib/CodeGen/GlobalISel/IRTranslator.cpp Thu Jun 27 16:37:04 2019
@@ -1560,14 +1560,16 @@ bool IRTranslator::translateCall(const U
ArrayRef<Register> Res = getOrCreateVRegs(CI);
SmallVector<ArrayRef<Register>, 8> Args;
+ SmallVector<Register, 8> InVRegs;
Register SwiftErrorVReg = 0;
for (auto &Arg: CI.arg_operands()) {
if (CLI->supportSwiftError() && isSwiftError(Arg)) {
LLT Ty = getLLTForType(*Arg->getType(), *DL);
- Register InVReg = MRI->createGenericVirtualRegister(Ty);
- MIRBuilder.buildCopy(InVReg, SwiftError.getOrCreateVRegUseAt(
- &CI, &MIRBuilder.getMBB(), Arg));
- Args.push_back(InVReg);
+ InVRegs.push_back(MRI->createGenericVirtualRegister(Ty));
+ MIRBuilder.buildCopy(
+ InVRegs.back(),
+ SwiftError.getOrCreateVRegUseAt(&CI, &MIRBuilder.getMBB(), Arg));
+ Args.emplace_back(llvm::makeArrayRef(InVRegs.back()));
SwiftErrorVReg =
SwiftError.getOrCreateVRegDefAt(&CI, &MIRBuilder.getMBB(), Arg);
continue;
More information about the llvm-commits
mailing list