[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
This commit is contained in:
Vitaly Buka 2022-03-29 18:35:55 -07:00
parent 6ae13b74d6
commit 15972e37ba

View File

@ -109,10 +109,10 @@ public:
private:
using Instructions = ilist<MachineInstr, ilist_sentinel_tracking<true>>;
Instructions Insts;
const BasicBlock *BB;
int Number;
MachineFunction *xParent;
Instructions Insts;
/// Keep track of the predecessor / successor basic blocks.
std::vector<MachineBasicBlock *> Predecessors;