Files
clang-p2996/llvm/lib/Target/AMDGPU/SIFrameLowering.cpp
Akshay Khadse 842dc35fc9 Guard against dereferencing a nullptr
In `lib/CodeGen/PrologEpilogInserter.cpp` file, `RS` is assigned via `RS = TRI->requiresRegisterScavenging(MF) ? new RegScavenger() : nullptr;`. This means that `RS` can be `nullptr`. While executing the `TFI->processFunctionBeforeFrameFinalized(MF, RS);`, the `RS` can be dereferenced in the call `RS->enterBasicBlock(MBB);` in file `lib/Target/AMDGPU/SIFrameLowering.cpp`

Reviewed By: skan, arsenm

Differential Revision: https://reviews.llvm.org/D146791
2023-04-15 11:30:43 +08:00

69 KiB