[all-commits] [llvm/llvm-project] ec2e5b: Fix iterator corruption in splitBasicBlockBefore

Max Kazantsev via All-commits all-commits at lists.llvm.org
Thu Oct 27 04:11:22 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: ec2e5b8c92e6fc98fdb33ff1bd4fba5f92dc7194
      https://github.com/llvm/llvm-project/commit/ec2e5b8c92e6fc98fdb33ff1bd4fba5f92dc7194
  Author: Max Kazantsev <mkazantsev at azul.com>
  Date:   2022-10-27 (Thu, 27 Oct 2022)

  Changed paths:
    M llvm/lib/IR/BasicBlock.cpp

  Log Message:
  -----------
  Fix iterator corruption in splitBasicBlockBefore

We should not delete block predecessors (via replacing successors
of terminators) while iterating them, otherwise we may skip some
of them. Instead, save predecessors to a separate vector and iterate
over it.




More information about the All-commits mailing list