From 2bf05a13b3bab68a9817b2bd4cccc8b6f9c81abc Mon Sep 17 00:00:00 2001 From: Christian Banse Date: Mon, 23 Sep 2024 17:42:39 +0200 Subject: [PATCH] Fixes `ConcurrentModificationException` (#1689) Since the prev/nextDFG edges are mirrored, clearing them manually is actually triggering an exception now. This removes the manual removal. --- .../src/main/kotlin/de/fraunhofer/aisec/cpg/passes/DFGPass.kt | 1 - 1 file changed, 1 deletion(-) diff --git a/cpg-core/src/main/kotlin/de/fraunhofer/aisec/cpg/passes/DFGPass.kt b/cpg-core/src/main/kotlin/de/fraunhofer/aisec/cpg/passes/DFGPass.kt index 53a9bfce456..6d731705ac6 100644 --- a/cpg-core/src/main/kotlin/de/fraunhofer/aisec/cpg/passes/DFGPass.kt +++ b/cpg-core/src/main/kotlin/de/fraunhofer/aisec/cpg/passes/DFGPass.kt @@ -459,7 +459,6 @@ class DFGPass(ctx: TranslationContext) : ComponentPass(ctx) { fun handleCallExpression(call: CallExpression, inferDfgForUnresolvedSymbols: Boolean) { // Remove existing DFG edges since they are no longer valid (e.g. after updating the // CallExpression with the invokes edges to the called functions) - call.prevDFG.forEach { it.nextDFGEdges.removeIf { edge -> edge.end == call } } call.prevDFGEdges.clear() if (call.invokes.isEmpty() && inferDfgForUnresolvedSymbols) {