[PATCH] D61881: Deal with return-twice function such as vfork, setjmp when CET-IBT enabled
Xiang Zhang via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu May 16 18:22:38 PDT 2019
xiangzhangllvm marked 2 inline comments as done.
xiangzhangllvm added inline comments.
================
Comment at: lib/Target/X86/X86IndirectBranchTracking.cpp:139
+
+ for (MachineBasicBlock::iterator I = MBB.begin(), E = MBB.end(); I != E;
+ ++I) {
----------------
I find here line 139 maybe problem:
I should change to
```
for (MachineBasicBlock::iterator I = MBB.begin(); I != MBB.end(); //because the MBB may update by insert endbr.
```
================
Comment at: lib/Target/X86/X86IndirectBranchTracking.cpp:144
+ if (IsCallReturnTwice(I->getOperand(0)))
+ Changed |= addENDBR(MBB, I);
+ }
----------------
craig.topper wrote:
> What if we passed I++ here and passed MBB.begin() on the other callsites. Could we then avoid two different cases in addENDBR?
Hi Craig, we can not avoid.
because the 2 cases in addENDBR(MBB, I) are different.
one case is insert endbr after I
and another case is insert endbr before I
Repository:
rL LLVM
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D61881/new/
https://reviews.llvm.org/D61881
More information about the llvm-commits
mailing list