summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/X86/X86LoadValueInjectionRetHardening.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/Target/X86/X86LoadValueInjectionRetHardening.cpp')
-rw-r--r--llvm/lib/Target/X86/X86LoadValueInjectionRetHardening.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/llvm/lib/Target/X86/X86LoadValueInjectionRetHardening.cpp b/llvm/lib/Target/X86/X86LoadValueInjectionRetHardening.cpp
index 9c36e86099f..6e1134a2595 100644
--- a/llvm/lib/Target/X86/X86LoadValueInjectionRetHardening.cpp
+++ b/llvm/lib/Target/X86/X86LoadValueInjectionRetHardening.cpp
@@ -99,6 +99,9 @@ bool X86LoadValueInjectionRetHardeningPass::runOnMachineFunction(
bool Modified = false;
for (auto &MBB : MF) {
+ if (MBB.empty())
+ continue;
+
MachineInstr &MI = MBB.back();
if (MI.getOpcode() != X86::RETQ)
continue;
OpenPOWER on IntegriCloud