[llvm] Add non-null check before accessing pointer (PR #83459)
Martin Wehking via llvm-commits
llvm-commits at lists.llvm.org
Fri Mar 1 05:50:06 PST 2024
================
@@ -1054,7 +1054,7 @@ void SIFoldOperands::foldOperand(
// Don't fold if OpToFold doesn't hold an aligned register.
const TargetRegisterClass *RC =
TRI->getRegClassForReg(*MRI, OpToFold.getReg());
- if (TRI->hasVectorRegisters(RC) && OpToFold.getSubReg()) {
+ if (RC && TRI->hasVectorRegisters(RC) && OpToFold.getSubReg()) {
----------------
MartinWehking wrote:
Ok, then we can close this PR again
https://github.com/llvm/llvm-project/pull/83459
More information about the llvm-commits
mailing list