Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
oxisto committed Nov 28, 2024
1 parent 9d5f539 commit 925a4f4
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,14 @@ fun applyMissingParams(
if (missingParam.refersTo == null) {
val currentScope = scopeManager.currentScope
scopeManager.jumpTo(missingParam.scope)
missingParam.refersTo = scopeManager.resolveReference(missingParam)
missingParam.refersTo =
scopeManager
.lookupSymbolByName(
missingParam.name,
missingParam.location,
missingParam.scope
)
.singleOrNull()
scopeManager.jumpTo(currentScope)
}
missingParam = missingParam.refersTo
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ package de.fraunhofer.aisec.cpg.frontends.cxx
import de.fraunhofer.aisec.cpg.graph.*
import de.fraunhofer.aisec.cpg.graph.declarations.FunctionDeclaration
import de.fraunhofer.aisec.cpg.graph.declarations.MethodDeclaration
import de.fraunhofer.aisec.cpg.graph.declarations.ValueDeclaration
import de.fraunhofer.aisec.cpg.graph.statements.expressions.*
import de.fraunhofer.aisec.cpg.graph.types.FunctionType
import de.fraunhofer.aisec.cpg.graph.types.Type
Expand Down Expand Up @@ -140,9 +141,11 @@ class ExpressionHandler(lang: CXXLanguageFrontend) :
} else {
if (capture.isByReference) {
val valueDeclaration =
frontend.scopeManager.resolveReference(
newReference(capture?.identifier?.toString())
)
frontend.scopeManager
.lookupSymbolByName(newName(capture.identifier?.toString() ?: "")) {
it is ValueDeclaration
}
.singleOrNull() as? ValueDeclaration
valueDeclaration?.let { lambda.mutableVariables.add(it) }
}
}
Expand Down

0 comments on commit 925a4f4

Please sign in to comment.