[midend-CFGOpt]修复上一次提交的漏洞

This commit is contained in:
rain2133
2025-08-11 18:46:07 +08:00
parent 46179e3866
commit 1361156b0d

View File

@ -116,7 +116,8 @@ bool SysYCFGOptUtils::SysYBlockMerge(Function *func) {
// 用usedelete删除会导致use关系被删除我只希望移动指令到当前块
// institer = SysYIROptUtils::usedelete(institer);
// institer = nextBlock->getInstructions().erase(institer);
nextBlock->moveInst(institer, block->getInstructions().end(), block);
institer = nextBlock->moveInst(institer, block->getInstructions().end(), block);
}
// 更新前驱后继关系,类似树节点操作
block->removeSuccessor(nextBlock);