Skip to content

Commit 86b120e

Browse files
authored
Merge pull request #69 from AdrianCX/acruceru/segv-compile
[X86] Fix to X86LoadValueInjectionRetHardeningPass for possible segfault
2 parents 6810e22 + a2c62c7 commit 86b120e

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

llvm/lib/Target/X86/X86LoadValueInjectionRetHardening.cpp

+3
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,9 @@ bool X86LoadValueInjectionRetHardeningPass::runOnMachineFunction(
9999

100100
bool Modified = false;
101101
for (auto &MBB : MF) {
102+
if (MBB.empty())
103+
continue;
104+
102105
MachineInstr &MI = MBB.back();
103106
if (MI.getOpcode() != X86::RETQ)
104107
continue;

0 commit comments

Comments
 (0)