From e6363218b7442ffcac3894d8edd0c8f0dee6f11b Mon Sep 17 00:00:00 2001 From: Mathias Morbitzer Date: Wed, 27 Dec 2023 15:06:46 +0100 Subject: [PATCH] now with identityset --- .../fraunhofer/aisec/cpg/passes/ProgramDependenceGraphPass.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cpg-core/src/main/kotlin/de/fraunhofer/aisec/cpg/passes/ProgramDependenceGraphPass.kt b/cpg-core/src/main/kotlin/de/fraunhofer/aisec/cpg/passes/ProgramDependenceGraphPass.kt index e1418255e5..736ac8a38c 100644 --- a/cpg-core/src/main/kotlin/de/fraunhofer/aisec/cpg/passes/ProgramDependenceGraphPass.kt +++ b/cpg-core/src/main/kotlin/de/fraunhofer/aisec/cpg/passes/ProgramDependenceGraphPass.kt @@ -32,6 +32,7 @@ import de.fraunhofer.aisec.cpg.graph.declarations.ValueDeclaration import de.fraunhofer.aisec.cpg.graph.edge.DependenceType import de.fraunhofer.aisec.cpg.graph.edge.PropertyEdge import de.fraunhofer.aisec.cpg.graph.statements.expressions.Reference +import de.fraunhofer.aisec.cpg.helpers.identitySetOf import de.fraunhofer.aisec.cpg.passes.order.DependsOn import de.fraunhofer.aisec.cpg.processing.IVisitor import de.fraunhofer.aisec.cpg.processing.strategy.Strategy @@ -97,7 +98,7 @@ class ProgramDependenceGraphPass(ctx: TranslationContext) : TranslationUnitPass( private fun allEOGsFromToFlowThrough(from: Node, to: Node, through: Node): Boolean { val worklist = mutableListOf(from) - val alreadySeenNodes = mutableSetOf() + val alreadySeenNodes = identitySetOf() while (worklist.isNotEmpty()) { val currentStatus = worklist.removeFirst()