From 4ebcc747e272dd3e9e4f0b9d6f44bc524b72614f Mon Sep 17 00:00:00 2001 From: Pavel Kosov Date: Thu, 4 May 2023 12:08:24 +0300 Subject: [PATCH] [PAC-CFI] Fix warning reference cannot be bound to dereferenced null pointer Fix a warning introduced in https://gitee.com/openharmony/third_party_llvm-project/pulls/189 warning: reference cannot be bound to dereferenced null pointer in well-defined C++ code; comparison may be assumed to always evaluate to true [-Wtautological-undefined-compare] MIi cannot be nullptr in this case, so this check can be removed Issue: https://gitee.com/openharmony/third_party_llvm-project/issues/I6VI2O Signed-off-by: Pavel Kosov --- .../Target/AArch64/AArch64PARTS/AArch64EarlyPartsCpiPass.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/llvm/lib/Target/AArch64/AArch64PARTS/AArch64EarlyPartsCpiPass.cpp b/llvm/lib/Target/AArch64/AArch64PARTS/AArch64EarlyPartsCpiPass.cpp index 63d38b6729f9..c590344b93bc 100644 --- a/llvm/lib/Target/AArch64/AArch64PARTS/AArch64EarlyPartsCpiPass.cpp +++ b/llvm/lib/Target/AArch64/AArch64PARTS/AArch64EarlyPartsCpiPass.cpp @@ -127,7 +127,7 @@ inline MachineInstr* AArch64EarlyPartsCpiPass::findIndirectCallMachineInstr(Mach unsigned BLRinstr_oper0 = 0; for (auto &MBB: MF) { for (auto MIi = MBB.instr_begin(), MIie = MBB.instr_end(); MIi != MIie; ++MIi) { - if (&*MIi != nullptr && isIndirectCall(*MIi)) { + if (isIndirectCall(*MIi)) { BLRinstr_oper0 = MIi->getOperand(0).getReg(); if (AUTCALLinstr_oper0 == BLRinstr_oper0) { return &*MIi; -- Gitee