[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. llvm-svn: 351955
This commit is contained in:
parent
c7956346da
commit
4ebed81fc4
|
@ -1775,8 +1775,8 @@ bool AArch64FrameLowering::spillCalleeSavedRegisters(
|
|||
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);
|
||||
|
|
Loading…
Reference in New Issue