Skip to content

Commit 0b64400

Browse files
committed
RegisterClassInfo::computePSetLimit - assert that we actually find a register.
Fixes "pointer is null" clang static analyzer warning.
1 parent 7b15865 commit 0b64400

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

llvm/lib/CodeGen/RegisterClassInfo.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,7 @@ unsigned RegisterClassInfo::computePSetLimit(unsigned Idx) const {
186186
NumRCUnits = NUnits;
187187
}
188188
}
189+
assert(RC && "Failed to find register class");
189190
compute(RC);
190191
unsigned NReserved = RC->getNumRegs() - getNumAllocatableRegs(RC);
191192
return TRI->getRegPressureSetLimit(*MF, Idx) -

0 commit comments

Comments
 (0)