Skip to content

Commit 15972e3

Browse files
committed
[CodeGen] Avoid access after runtime
Insts must be destroyd before xParent or it can read it with stack like this: 0 in llvm::MachineInstr::getMF() const MachineInstr.cpp:637:3 1 in getMF MachineInstr.h:302:50 2 in removeNodeFromList MachineBasicBlock.cpp:163:32
1 parent 6ae13b7 commit 15972e3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

llvm/include/llvm/CodeGen/MachineBasicBlock.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,10 +109,10 @@ class MachineBasicBlock
109109
private:
110110
using Instructions = ilist<MachineInstr, ilist_sentinel_tracking<true>>;
111111

112-
Instructions Insts;
113112
const BasicBlock *BB;
114113
int Number;
115114
MachineFunction *xParent;
115+
Instructions Insts;
116116

117117
/// Keep track of the predecessor / successor basic blocks.
118118
std::vector<MachineBasicBlock *> Predecessors;

0 commit comments

Comments
 (0)