From 93f11a3aebedd4592eb97370d3046b679856f51c Mon Sep 17 00:00:00 2001 From: Christian Banse Date: Fri, 24 Nov 2023 12:42:25 +0100 Subject: [PATCH] Rebased with parallel passes --- .../de/fraunhofer/aisec/cpg/graph/builder/Fluent.kt | 4 ---- .../aisec/cpg/passes/ControlFlowSensitiveDFGPass.kt | 8 ++++++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/cpg-core/src/main/kotlin/de/fraunhofer/aisec/cpg/graph/builder/Fluent.kt b/cpg-core/src/main/kotlin/de/fraunhofer/aisec/cpg/graph/builder/Fluent.kt index bb9e00533f6..8545b8396c2 100644 --- a/cpg-core/src/main/kotlin/de/fraunhofer/aisec/cpg/graph/builder/Fluent.kt +++ b/cpg-core/src/main/kotlin/de/fraunhofer/aisec/cpg/graph/builder/Fluent.kt @@ -50,7 +50,6 @@ fun LanguageFrontend<*, *>.translationResult( node.addComponent(component) init(node) -<<<<<<< HEAD if (ctx.config.useParallelPasses) { for (list in ctx.config.registeredPasses) { executePassesInParallel(list, ctx, node, listOf()) @@ -58,9 +57,6 @@ fun LanguageFrontend<*, *>.translationResult( } else { ctx.config.registeredPasses.flatten().forEach { executePass(it, ctx, node, listOf()) } } -======= - ctx.config.registeredPasses.flatten().forEach { executePassSequential(it, ctx, node, listOf()) } ->>>>>>> 0dc5b459c (Experimental support to run passes in parallel) return node } diff --git a/cpg-core/src/main/kotlin/de/fraunhofer/aisec/cpg/passes/ControlFlowSensitiveDFGPass.kt b/cpg-core/src/main/kotlin/de/fraunhofer/aisec/cpg/passes/ControlFlowSensitiveDFGPass.kt index 11d0c9ed81d..f86d84b4293 100644 --- a/cpg-core/src/main/kotlin/de/fraunhofer/aisec/cpg/passes/ControlFlowSensitiveDFGPass.kt +++ b/cpg-core/src/main/kotlin/de/fraunhofer/aisec/cpg/passes/ControlFlowSensitiveDFGPass.kt @@ -111,13 +111,17 @@ open class ControlFlowSensitiveDFGPass(ctx: TranslationContext) : EOGStarterPass // elements. We have the indices here, so it's amazing. key.elements.forEachIndexed { i, element -> element.addAllPrevDFG( - value.elements.filterNot { it is VariableDeclaration && key == it }, + value.elements.filterNot { + (it is VariableDeclaration || it is ParameterDeclaration) && key == it + }, mutableMapOf(Properties.INDEX to i) ) } } else { key.addAllPrevDFG( - value.elements.filterNot { it is VariableDeclaration && key == it } + value.elements.filterNot { + (it is VariableDeclaration || it is ParameterDeclaration) && key == it + } ) } }