Skip to content

Commit e9b7d78

Browse files
author
Amirhossein Pashaeehir
committed
Assert ref reg when using it
1 parent bc5b570 commit e9b7d78

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

llvm/lib/DWARFCFIChecker/DWARFCFIAnalysis.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,9 @@ void DWARFCFIAnalysis::checkRegDiff(
222222
switch (PrevLoc.getLocation()) {
223223
case dwarf::UnwindLocation::Same:
224224
case dwarf::UnwindLocation::RegPlusOffset:
225+
assert(MaybePrevRefReg &&
226+
"when the unwinding rule is the same value, or reg plus offset, "
227+
"there should always exist a reference register");
225228
if (Writes.count(MaybePrevRefReg.value())) {
226229
Context->reportError(
227230
Inst.getLoc(),

0 commit comments

Comments
 (0)