Skip to content

Commit c1ffa81

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

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

llvm/lib/CodeGen/CFIInstrInserter.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -319,10 +319,12 @@ void CFIInstrInserter::calculateOutgoingCFAInfo(MBBCFAInfo &MBBInfo) {
319319
case MCCFIInstruction::OpValOffset:
320320
break;
321321
}
322+
assert((bool)CSRReg + (bool)CSROffset <= 1 &&
323+
"Different saved locations for the same CSR");
322324
CSRSavedLocation CSRLoc;
323325
if (CSRReg)
324326
CSRLoc = CSRSavedLocation::createRegister(*CSRReg);
325-
if (CSROffset)
327+
else if (CSROffset)
326328
CSRLoc = CSRSavedLocation::createCFAOffset(*CSROffset);
327329
if (CSRLoc.isValid()) {
328330
auto It = CSRLocMap.find(CFI.getRegister());

0 commit comments

Comments
 (0)