diff --git a/numba_rvsdg/core/datastructures/scfg.py b/numba_rvsdg/core/datastructures/scfg.py index 3e3a96d..5018266 100644 --- a/numba_rvsdg/core/datastructures/scfg.py +++ b/numba_rvsdg/core/datastructures/scfg.py @@ -524,6 +524,11 @@ def insert_block( block_type: SyntheticBlock The type/class of the newly created block. """ + # To prevent spurious mutations in successsors and predecessors + # since they are a part of the graph. + successors = successors.copy() + predecessors = predecessors.copy() + # TODO: needs a diagram and documentaion # initialize new block new_block = block_type(