diff --git a/sootup.core/src/main/java/sootup/core/graph/MutableBlockStmtGraph.java b/sootup.core/src/main/java/sootup/core/graph/MutableBlockStmtGraph.java index 7a264665d07..4ec00c1aff2 100644 --- a/sootup.core/src/main/java/sootup/core/graph/MutableBlockStmtGraph.java +++ b/sootup.core/src/main/java/sootup/core/graph/MutableBlockStmtGraph.java @@ -847,7 +847,11 @@ public void insertBefore( (type, handler) -> successorBlock.addExceptionalSuccessorBlock(type, getOrCreateBlock(handler))); stmts.forEach(stmt -> addNodeToBlock(block, stmt)); - tryMergeBlocks(block, successorBlock); + if (!tryMergeBlocks(block, successorBlock)) { + // update index: for splitted stmts + successorBlock.getStmts().forEach((stmt) -> stmtToBlock.put(stmt, successorBlock)); + blocks.add(successorBlock); + } } if (beforeStmt == getStartingStmt()) {