Skip to content

Commit 76b10c1

Browse files
author
Mikhail Gudim
committed
addressed review comments.
1 parent 0db6b47 commit 76b10c1

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

llvm/lib/CodeGen/CFIInstrInserter.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -319,10 +319,13 @@ void CFIInstrInserter::calculateOutgoingCFAInfo(MBBCFAInfo &MBBInfo) {
319319
case MCCFIInstruction::OpValOffset:
320320
break;
321321
}
322+
assert((bool)CSRReg + (bool)CSROffset <= 1 &&
323+
"A register can only be at an offset from CFA or in another "
324+
"register, but not both!");
322325
CSRSavedLocation CSRLoc;
323326
if (CSRReg)
324327
CSRLoc = CSRSavedLocation::createRegister(*CSRReg);
325-
if (CSROffset)
328+
else if (CSROffset)
326329
CSRLoc = CSRSavedLocation::createCFAOffset(*CSROffset);
327330
if (CSRLoc.isValid()) {
328331
auto It = CSRLocMap.find(CFI.getRegister());

0 commit comments

Comments
 (0)