[llvm] r351955 - [AArch64] Fix out of bounds strlen
Benjamin Kramer via llvm-commits
llvm-commits at lists.llvm.org
Wed Jan 23 06:51:21 PST 2019
Author: d0k
Date: Wed Jan 23 06:51:21 2019
New Revision: 351955
URL: http://llvm.org/viewvc/llvm-project?rev=351955&view=rev
Log:
[AArch64] Fix out of bounds strlen
CFIInst is not zero-terminated. This is one of more annoying functional
differences between StringRef and ArrayRef.
Found by asan.
Modified:
llvm/trunk/lib/Target/AArch64/AArch64FrameLowering.cpp
Modified: llvm/trunk/lib/Target/AArch64/AArch64FrameLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AArch64/AArch64FrameLowering.cpp?rev=351955&r1=351954&r2=351955&view=diff
==============================================================================
--- llvm/trunk/lib/Target/AArch64/AArch64FrameLowering.cpp (original)
+++ llvm/trunk/lib/Target/AArch64/AArch64FrameLowering.cpp Wed Jan 23 06:51:21 2019
@@ -1775,8 +1775,8 @@ bool AArch64FrameLowering::spillCalleeSa
static_cast<char>(unsigned(dwarf::DW_OP_breg18)),
static_cast<char>(-8) & 0x7f, // addend (sleb128)
};
- unsigned CFIIndex =
- MF.addFrameInst(MCCFIInstruction::createEscape(nullptr, CFIInst));
+ unsigned CFIIndex = MF.addFrameInst(MCCFIInstruction::createEscape(
+ nullptr, StringRef(CFIInst, sizeof(CFIInst))));
BuildMI(MBB, MI, DL, TII.get(AArch64::CFI_INSTRUCTION))
.addCFIIndex(CFIIndex)
.setMIFlag(MachineInstr::FrameSetup);
More information about the llvm-commits
mailing list