{"push_id":754818782,"size":1,"distinct_size":1,"ref":"refs/heads/master","head":"d0d9d95d91d08c9fa559308c0b8d9257c588f6e8","before":"0a6bfc1376c0a5e9d1f30998c4df9470b8a06b7e","commits":[{"sha":"d0d9d95d91d08c9fa559308c0b8d9257c588f6e8","author":{"email":"54438ec01a34c7018b680862e4f5411be9b438c0@gmail.com","name":"Chen Li"},"message":"[LowerSwitch] Fix a bug when LowerSwitch deletes the default block\n\nSummary: LowerSwitch crashed with the attached test case after deleting the default block. This happened because the current implementation of deleting dead blocks is wrong. After the default block being deleted, it contains no instruction or terminator, and it should no be traversed anymore. However, since the iterator is advanced before processSwitchInst() function is executed, the block advanced to could be deleted inside processSwitchInst(). The deleted block would then be visited next and crash dyn_cast<SwitchInst>(Cur->getTerminator()) because Cur->getTerminator() returns a nullptr. This patch fixes this problem by recording dead default blocks into a list, and delete them after all processSwitchInst() has been done. It still possible to visit dead default blocks and waste time process them. But it is a compile time issue, and I plan to have another patch to add support to skip dead blocks.\n\nReviewers: kariddi, resistor, hans, reames\n\nSubscribers: llvm-commits\n\nDifferential Revision: http://reviews.llvm.org/D11852","distinct":true,"url":"https://api.github.com/repos/llvm-project/llvm-project/commits/d0d9d95d91d08c9fa559308c0b8d9257c588f6e8"}]}