[llvm] r342845 - [Aarch64] Fix memcpy that was copying 4x too many bytes
Benjamin Kramer via llvm-commits
llvm-commits at lists.llvm.org
Sun Sep 23 11:43:28 PDT 2018
Author: d0k
Date: Sun Sep 23 11:43:28 2018
New Revision: 342845
URL: http://llvm.org/viewvc/llvm-project?rev=342845&view=rev
Log:
[Aarch64] Fix memcpy that was copying 4x too many bytes
Found by asan.
Modified:
llvm/trunk/lib/Target/AArch64/AArch64RegisterInfo.cpp
Modified: llvm/trunk/lib/Target/AArch64/AArch64RegisterInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AArch64/AArch64RegisterInfo.cpp?rev=342845&r1=342844&r2=342845&view=diff
==============================================================================
--- llvm/trunk/lib/Target/AArch64/AArch64RegisterInfo.cpp (original)
+++ llvm/trunk/lib/Target/AArch64/AArch64RegisterInfo.cpp Sun Sep 23 11:43:28 2018
@@ -143,7 +143,7 @@ void AArch64RegisterInfo::UpdateCustomCa
const uint32_t **Mask) const {
uint32_t *UpdatedMask = MF.allocateRegMask();
unsigned RegMaskSize = MachineOperand::getRegMaskSize(getNumRegs());
- memcpy(UpdatedMask, *Mask, sizeof(Mask[0]) * RegMaskSize);
+ memcpy(UpdatedMask, *Mask, sizeof(UpdatedMask[0]) * RegMaskSize);
for (size_t i = 0; i < AArch64::GPR64commonRegClass.getNumRegs(); ++i) {
if (MF.getSubtarget<AArch64Subtarget>().isXRegCustomCalleeSaved(i)) {
More information about the llvm-commits
mailing list