Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only store ctx in handlers, frontends and passes #2126

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,9 @@
*/
package de.fraunhofer.aisec.codyze.compliance

import de.fraunhofer.aisec.cpg.ScopeManager
import de.fraunhofer.aisec.cpg.TranslationConfiguration
import de.fraunhofer.aisec.cpg.TranslationContext
import de.fraunhofer.aisec.cpg.TranslationManager
import de.fraunhofer.aisec.cpg.TranslationResult
import de.fraunhofer.aisec.cpg.TypeManager
import de.fraunhofer.aisec.cpg.graph.Component
import de.fraunhofer.aisec.cpg.graph.Name
import kotlin.io.path.Path
Expand Down Expand Up @@ -75,11 +72,7 @@ class SecurityGoalTest {
val result =
TranslationResult(
translationManager = TranslationManager.builder().build(),
TranslationContext(
config = TranslationConfiguration.builder().build(),
scopeManager = ScopeManager(),
typeManager = TypeManager(),
),
TranslationContext(),
)
val auth = Component().also { it.name = Name("auth") }
result.components += auth
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
package de.fraunhofer.aisec.cpg.graph.concepts.memory

import de.fraunhofer.aisec.cpg.graph.Component
import de.fraunhofer.aisec.cpg.graph.ContextProvider
import de.fraunhofer.aisec.cpg.graph.Node
import de.fraunhofer.aisec.cpg.graph.concepts.Concept
import de.fraunhofer.aisec.cpg.graph.concepts.arch.OperatingSystemArchitecture
Expand Down Expand Up @@ -61,6 +62,7 @@ abstract class DynamicLoadingOperation<T : Node>(
* The [underlyingNode] is most likely a function call and [what] can point to a [Component]
* representing the library.
*/
@Suppress("CONTEXT_RECEIVERS_DEPRECATED")
class LoadLibrary(
underlyingNode: Node,
concept: Concept,
Expand All @@ -84,6 +86,7 @@ class LoadLibrary(
os = os,
) {

context(ContextProvider)
/** Looks up symbol candidates for [symbol] in the [LoadLibrary.what]. */
fun findSymbol(symbol: Symbol?): List<Declaration> {
if (symbol == null) {
Expand Down
Loading
Loading