diff --git a/buildSrc/src/main/kotlin/Dependencies.kt b/buildSrc/src/main/kotlin/Dependencies.kt index 1f3b2f8c76..b9c3771821 100644 --- a/buildSrc/src/main/kotlin/Dependencies.kt +++ b/buildSrc/src/main/kotlin/Dependencies.kt @@ -5,7 +5,7 @@ import org.gradle.plugin.use.PluginDependenciesSpec object Versions { const val detekt = "1.18.1" const val ini4j = "0.5.4" - const val jacodb = "6539d5020c" + const val jacodb = "ad5e1f170e" const val juliet = "1.3.2" const val junit = "5.9.3" const val kotlin = "2.1.0" diff --git a/usvm-dataflow/src/main/kotlin/org/usvm/dataflow/graph/ApplicationGraph.kt b/usvm-dataflow/src/main/kotlin/org/usvm/dataflow/graph/ApplicationGraph.kt new file mode 100644 index 0000000000..25b8866804 --- /dev/null +++ b/usvm-dataflow/src/main/kotlin/org/usvm/dataflow/graph/ApplicationGraph.kt @@ -0,0 +1,23 @@ +package org.usvm.dataflow.graph + +import org.jacodb.api.common.CommonMethod +import org.jacodb.api.common.cfg.CommonInst + +/** + * Provides both CFG and call graph (i.e., the supergraph in terms of RHS95 paper). + */ +interface ApplicationGraph + where Method : CommonMethod, + Statement : CommonInst { + + fun predecessors(node: Statement): Sequence + fun successors(node: Statement): Sequence + + fun callees(node: Statement): Sequence + fun callers(method: Method): Sequence + + fun entryPoints(method: Method): Sequence + fun exitPoints(method: Method): Sequence + + fun methodOf(node: Statement): Method +} diff --git a/usvm-dataflow/src/main/kotlin/org/usvm/dataflow/graph/BackwardGraphs.kt b/usvm-dataflow/src/main/kotlin/org/usvm/dataflow/graph/BackwardGraphs.kt index 5bf8b5e562..915f39b3f0 100644 --- a/usvm-dataflow/src/main/kotlin/org/usvm/dataflow/graph/BackwardGraphs.kt +++ b/usvm-dataflow/src/main/kotlin/org/usvm/dataflow/graph/BackwardGraphs.kt @@ -19,7 +19,6 @@ package org.usvm.dataflow.graph import org.jacodb.api.common.CommonMethod -import org.jacodb.api.common.analysis.ApplicationGraph import org.jacodb.api.common.cfg.CommonInst private class BackwardApplicationGraphImpl( diff --git a/usvm-dataflow/src/main/kotlin/org/usvm/dataflow/ifds/Runner.kt b/usvm-dataflow/src/main/kotlin/org/usvm/dataflow/ifds/Runner.kt index e5552622cb..997cc3b05c 100644 --- a/usvm-dataflow/src/main/kotlin/org/usvm/dataflow/ifds/Runner.kt +++ b/usvm-dataflow/src/main/kotlin/org/usvm/dataflow/ifds/Runner.kt @@ -22,8 +22,8 @@ import kotlinx.coroutines.channels.getOrElse import kotlinx.coroutines.coroutineScope import kotlinx.coroutines.isActive import org.jacodb.api.common.CommonMethod -import org.jacodb.api.common.analysis.ApplicationGraph import org.jacodb.api.common.cfg.CommonInst +import org.usvm.dataflow.graph.ApplicationGraph import org.usvm.dataflow.util.Traits import java.util.concurrent.ConcurrentHashMap diff --git a/usvm-dataflow/src/main/kotlin/org/usvm/dataflow/taint/TaintAnalyzers.kt b/usvm-dataflow/src/main/kotlin/org/usvm/dataflow/taint/TaintAnalyzers.kt index 8899bb4a34..06bbd49a46 100644 --- a/usvm-dataflow/src/main/kotlin/org/usvm/dataflow/taint/TaintAnalyzers.kt +++ b/usvm-dataflow/src/main/kotlin/org/usvm/dataflow/taint/TaintAnalyzers.kt @@ -18,12 +18,12 @@ package org.usvm.dataflow.taint import mu.KLogging import org.jacodb.api.common.CommonMethod -import org.jacodb.api.common.analysis.ApplicationGraph import org.jacodb.api.common.cfg.CommonInst import org.jacodb.taint.configuration.TaintConfigurationItem import org.jacodb.taint.configuration.TaintMethodSink import org.usvm.dataflow.config.CallPositionToValueResolver import org.usvm.dataflow.config.FactAwareConditionEvaluator +import org.usvm.dataflow.graph.ApplicationGraph import org.usvm.dataflow.ifds.Analyzer import org.usvm.dataflow.ifds.Edge import org.usvm.dataflow.ifds.Reason diff --git a/usvm-dataflow/src/main/kotlin/org/usvm/dataflow/taint/TaintBidiRunner.kt b/usvm-dataflow/src/main/kotlin/org/usvm/dataflow/taint/TaintBidiRunner.kt index 4967c1f763..5bc0b24875 100644 --- a/usvm-dataflow/src/main/kotlin/org/usvm/dataflow/taint/TaintBidiRunner.kt +++ b/usvm-dataflow/src/main/kotlin/org/usvm/dataflow/taint/TaintBidiRunner.kt @@ -29,8 +29,8 @@ import org.usvm.dataflow.ifds.Reason import org.usvm.dataflow.ifds.UnitResolver import org.usvm.dataflow.ifds.UnitType import org.jacodb.api.common.CommonMethod -import org.jacodb.api.common.analysis.ApplicationGraph import org.jacodb.api.common.cfg.CommonInst +import org.usvm.dataflow.graph.ApplicationGraph class TaintBidiRunner( val manager: TaintManager, diff --git a/usvm-dataflow/src/main/kotlin/org/usvm/dataflow/taint/TaintFlowFunctions.kt b/usvm-dataflow/src/main/kotlin/org/usvm/dataflow/taint/TaintFlowFunctions.kt index 775cad9440..d64c6bed74 100644 --- a/usvm-dataflow/src/main/kotlin/org/usvm/dataflow/taint/TaintFlowFunctions.kt +++ b/usvm-dataflow/src/main/kotlin/org/usvm/dataflow/taint/TaintFlowFunctions.kt @@ -17,7 +17,6 @@ package org.usvm.dataflow.taint import org.jacodb.api.common.CommonMethod -import org.jacodb.api.common.analysis.ApplicationGraph import org.jacodb.api.common.cfg.CommonAssignInst import org.jacodb.api.common.cfg.CommonExpr import org.jacodb.api.common.cfg.CommonInst @@ -42,6 +41,7 @@ import org.usvm.dataflow.config.EntryPointPositionToAccessPathResolver import org.usvm.dataflow.config.EntryPointPositionToValueResolver import org.usvm.dataflow.config.FactAwareConditionEvaluator import org.usvm.dataflow.config.TaintActionEvaluator +import org.usvm.dataflow.graph.ApplicationGraph import org.usvm.dataflow.ifds.ElementAccessor import org.usvm.dataflow.ifds.FlowFunction import org.usvm.dataflow.ifds.FlowFunctions diff --git a/usvm-dataflow/src/main/kotlin/org/usvm/dataflow/taint/TaintManager.kt b/usvm-dataflow/src/main/kotlin/org/usvm/dataflow/taint/TaintManager.kt index b42469fd53..233e4791f5 100644 --- a/usvm-dataflow/src/main/kotlin/org/usvm/dataflow/taint/TaintManager.kt +++ b/usvm-dataflow/src/main/kotlin/org/usvm/dataflow/taint/TaintManager.kt @@ -30,9 +30,9 @@ import kotlinx.coroutines.launch import kotlinx.coroutines.runBlocking import kotlinx.coroutines.withTimeoutOrNull import org.jacodb.api.common.CommonMethod -import org.jacodb.api.common.analysis.ApplicationGraph import org.jacodb.api.common.cfg.CommonInst import org.jacodb.taint.configuration.TaintConfigurationItem +import org.usvm.dataflow.graph.ApplicationGraph import org.usvm.dataflow.graph.reversed import org.usvm.dataflow.ifds.ControlEvent import org.usvm.dataflow.ifds.IfdsResult diff --git a/usvm-jvm-dataflow/src/main/kotlin/org/usvm/dataflow/jvm/graph/ApplicationGraphFactory.kt b/usvm-jvm-dataflow/src/main/kotlin/org/usvm/dataflow/jvm/graph/ApplicationGraphFactory.kt index 88d9759137..ef70f55d95 100644 --- a/usvm-jvm-dataflow/src/main/kotlin/org/usvm/dataflow/jvm/graph/ApplicationGraphFactory.kt +++ b/usvm-jvm-dataflow/src/main/kotlin/org/usvm/dataflow/jvm/graph/ApplicationGraphFactory.kt @@ -22,7 +22,6 @@ import kotlinx.coroutines.DelicateCoroutinesApi import kotlinx.coroutines.GlobalScope import kotlinx.coroutines.future.future import org.jacodb.api.jvm.JcClasspath -import org.jacodb.api.jvm.analysis.JcApplicationGraph import org.jacodb.impl.features.usagesExt import java.util.concurrent.CompletableFuture diff --git a/usvm-jvm-dataflow/src/main/kotlin/org/usvm/dataflow/jvm/graph/JcApplicationGraph.kt b/usvm-jvm-dataflow/src/main/kotlin/org/usvm/dataflow/jvm/graph/JcApplicationGraph.kt new file mode 100644 index 0000000000..7b26dc1b56 --- /dev/null +++ b/usvm-jvm-dataflow/src/main/kotlin/org/usvm/dataflow/jvm/graph/JcApplicationGraph.kt @@ -0,0 +1,29 @@ +/* + * Copyright 2022 UnitTestBot contributors (utbot.org) + *

+ * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + *

+ * http://www.apache.org/licenses/LICENSE-2.0 + *

+ * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.usvm.dataflow.jvm.graph + +import org.jacodb.api.jvm.JcClasspath +import org.jacodb.api.jvm.JcMethod +import org.jacodb.api.jvm.cfg.JcInst +import org.usvm.dataflow.graph.ApplicationGraph + +/** + * Interface for [JcApplicationGraph] built with jacodb. + */ +interface JcApplicationGraph : ApplicationGraph { + val cp: JcClasspath +} diff --git a/usvm-jvm-dataflow/src/main/kotlin/org/usvm/dataflow/jvm/graph/JcApplicationGraphImpl.kt b/usvm-jvm-dataflow/src/main/kotlin/org/usvm/dataflow/jvm/graph/JcApplicationGraphImpl.kt index a24dc62347..628a7f671b 100644 --- a/usvm-jvm-dataflow/src/main/kotlin/org/usvm/dataflow/jvm/graph/JcApplicationGraphImpl.kt +++ b/usvm-jvm-dataflow/src/main/kotlin/org/usvm/dataflow/jvm/graph/JcApplicationGraphImpl.kt @@ -18,7 +18,6 @@ package org.usvm.dataflow.jvm.graph import org.jacodb.api.jvm.JcClasspath import org.jacodb.api.jvm.JcMethod -import org.jacodb.api.jvm.analysis.JcApplicationGraph import org.jacodb.api.jvm.cfg.JcInst import org.jacodb.api.jvm.ext.cfg.callExpr import org.jacodb.impl.features.SyncUsagesExtension diff --git a/usvm-jvm-dataflow/src/main/kotlin/org/usvm/dataflow/jvm/graph/SimplifiedJcApplicationGraph.kt b/usvm-jvm-dataflow/src/main/kotlin/org/usvm/dataflow/jvm/graph/SimplifiedJcApplicationGraph.kt index f2d412258d..7127c686c1 100644 --- a/usvm-jvm-dataflow/src/main/kotlin/org/usvm/dataflow/jvm/graph/SimplifiedJcApplicationGraph.kt +++ b/usvm-jvm-dataflow/src/main/kotlin/org/usvm/dataflow/jvm/graph/SimplifiedJcApplicationGraph.kt @@ -19,7 +19,6 @@ package org.usvm.dataflow.jvm.graph import kotlinx.coroutines.runBlocking import org.jacodb.api.jvm.JcClassType import org.jacodb.api.jvm.JcMethod -import org.jacodb.api.jvm.analysis.JcApplicationGraph import org.jacodb.api.jvm.cfg.JcInst import org.jacodb.api.jvm.cfg.JcVirtualCallExpr import org.jacodb.api.jvm.ext.cfg.callExpr diff --git a/usvm-jvm-dataflow/src/main/kotlin/org/usvm/dataflow/jvm/npe/NpeAnalyzers.kt b/usvm-jvm-dataflow/src/main/kotlin/org/usvm/dataflow/jvm/npe/NpeAnalyzers.kt index 49f080af6f..979d119c13 100644 --- a/usvm-jvm-dataflow/src/main/kotlin/org/usvm/dataflow/jvm/npe/NpeAnalyzers.kt +++ b/usvm-jvm-dataflow/src/main/kotlin/org/usvm/dataflow/jvm/npe/NpeAnalyzers.kt @@ -17,7 +17,6 @@ package org.usvm.dataflow.jvm.npe import org.jacodb.api.jvm.JcMethod -import org.jacodb.api.jvm.analysis.JcApplicationGraph import org.jacodb.api.jvm.cfg.JcInst import org.jacodb.taint.configuration.TaintConfigurationItem import org.jacodb.taint.configuration.TaintMark @@ -26,6 +25,7 @@ import org.usvm.dataflow.config.CallPositionToValueResolver import org.usvm.dataflow.config.FactAwareConditionEvaluator import org.usvm.dataflow.ifds.Analyzer import org.usvm.dataflow.ifds.Reason +import org.usvm.dataflow.jvm.graph.JcApplicationGraph import org.usvm.dataflow.jvm.util.JcTraits import org.usvm.dataflow.taint.EdgeForOtherRunner import org.usvm.dataflow.taint.NewSummaryEdge diff --git a/usvm-jvm-dataflow/src/main/kotlin/org/usvm/dataflow/jvm/npe/NpeFlowFunctions.kt b/usvm-jvm-dataflow/src/main/kotlin/org/usvm/dataflow/jvm/npe/NpeFlowFunctions.kt index dc61e8e4ad..5f1fa363b4 100644 --- a/usvm-jvm-dataflow/src/main/kotlin/org/usvm/dataflow/jvm/npe/NpeFlowFunctions.kt +++ b/usvm-jvm-dataflow/src/main/kotlin/org/usvm/dataflow/jvm/npe/NpeFlowFunctions.kt @@ -22,7 +22,6 @@ import org.jacodb.api.common.cfg.CommonValue import org.jacodb.api.jvm.JcArrayType import org.jacodb.api.jvm.JcClasspath import org.jacodb.api.jvm.JcMethod -import org.jacodb.api.jvm.analysis.JcApplicationGraph import org.jacodb.api.jvm.cfg.JcArgument import org.jacodb.api.jvm.cfg.JcAssignInst import org.jacodb.api.jvm.cfg.JcCallExpr @@ -65,6 +64,7 @@ import org.usvm.dataflow.ifds.isOnHeap import org.usvm.dataflow.ifds.isStatic import org.usvm.dataflow.ifds.minus import org.usvm.dataflow.ifds.onSome +import org.usvm.dataflow.jvm.graph.JcApplicationGraph import org.usvm.dataflow.jvm.util.JcTraits import org.usvm.dataflow.taint.TaintDomainFact import org.usvm.dataflow.taint.TaintZeroFact diff --git a/usvm-jvm-dataflow/src/main/kotlin/org/usvm/dataflow/jvm/npe/NpeManager.kt b/usvm-jvm-dataflow/src/main/kotlin/org/usvm/dataflow/jvm/npe/NpeManager.kt index 526242c8fe..b9d69c394d 100644 --- a/usvm-jvm-dataflow/src/main/kotlin/org/usvm/dataflow/jvm/npe/NpeManager.kt +++ b/usvm-jvm-dataflow/src/main/kotlin/org/usvm/dataflow/jvm/npe/NpeManager.kt @@ -17,7 +17,6 @@ package org.usvm.dataflow.jvm.npe import org.jacodb.api.jvm.JcMethod -import org.jacodb.api.jvm.analysis.JcApplicationGraph import org.jacodb.api.jvm.cfg.JcInst import org.jacodb.taint.configuration.TaintConfigurationFeature import org.jacodb.taint.configuration.TaintConfigurationItem @@ -25,6 +24,7 @@ import org.usvm.dataflow.ifds.UniRunner import org.usvm.dataflow.ifds.UnitResolver import org.usvm.dataflow.ifds.UnitType import org.usvm.dataflow.ifds.UnknownUnit +import org.usvm.dataflow.jvm.graph.JcApplicationGraph import org.usvm.dataflow.jvm.ifds.JcUnitResolver import org.usvm.dataflow.jvm.util.JcTraits import org.usvm.dataflow.taint.TaintManager diff --git a/usvm-jvm-dataflow/src/main/kotlin/org/usvm/dataflow/jvm/taint/TaintManager.kt b/usvm-jvm-dataflow/src/main/kotlin/org/usvm/dataflow/jvm/taint/TaintManager.kt index a08288c213..5a5c0303c8 100644 --- a/usvm-jvm-dataflow/src/main/kotlin/org/usvm/dataflow/jvm/taint/TaintManager.kt +++ b/usvm-jvm-dataflow/src/main/kotlin/org/usvm/dataflow/jvm/taint/TaintManager.kt @@ -1,10 +1,10 @@ package org.usvm.dataflow.jvm.taint import org.jacodb.api.jvm.JcMethod -import org.jacodb.api.jvm.analysis.JcApplicationGraph import org.jacodb.api.jvm.cfg.JcInst import org.jacodb.taint.configuration.TaintConfigurationFeature import org.jacodb.taint.configuration.TaintConfigurationItem +import org.usvm.dataflow.jvm.graph.JcApplicationGraph import org.usvm.dataflow.jvm.ifds.JcUnitResolver import org.usvm.dataflow.jvm.util.JcTraits import org.usvm.dataflow.taint.TaintManager diff --git a/usvm-jvm-dataflow/src/main/kotlin/org/usvm/dataflow/jvm/unused/UnusedVariableAnalyzer.kt b/usvm-jvm-dataflow/src/main/kotlin/org/usvm/dataflow/jvm/unused/UnusedVariableAnalyzer.kt index 843a7e6a75..1b9f3e9c65 100644 --- a/usvm-jvm-dataflow/src/main/kotlin/org/usvm/dataflow/jvm/unused/UnusedVariableAnalyzer.kt +++ b/usvm-jvm-dataflow/src/main/kotlin/org/usvm/dataflow/jvm/unused/UnusedVariableAnalyzer.kt @@ -17,8 +17,8 @@ package org.usvm.dataflow.jvm.unused import org.jacodb.api.common.CommonMethod -import org.jacodb.api.common.analysis.ApplicationGraph import org.jacodb.api.common.cfg.CommonInst +import org.usvm.dataflow.graph.ApplicationGraph import org.usvm.dataflow.ifds.Analyzer import org.usvm.dataflow.ifds.Edge import org.usvm.dataflow.ifds.Vertex diff --git a/usvm-jvm-dataflow/src/main/kotlin/org/usvm/dataflow/jvm/unused/UnusedVariableFlowFunctions.kt b/usvm-jvm-dataflow/src/main/kotlin/org/usvm/dataflow/jvm/unused/UnusedVariableFlowFunctions.kt index 711da46cf7..6e87281e76 100644 --- a/usvm-jvm-dataflow/src/main/kotlin/org/usvm/dataflow/jvm/unused/UnusedVariableFlowFunctions.kt +++ b/usvm-jvm-dataflow/src/main/kotlin/org/usvm/dataflow/jvm/unused/UnusedVariableFlowFunctions.kt @@ -17,11 +17,11 @@ package org.usvm.dataflow.jvm.unused import org.jacodb.api.common.CommonMethod -import org.jacodb.api.common.analysis.ApplicationGraph import org.jacodb.api.common.cfg.CommonAssignInst import org.jacodb.api.common.cfg.CommonInst import org.jacodb.api.jvm.cfg.JcSpecialCallExpr import org.jacodb.api.jvm.cfg.JcStaticCallExpr +import org.usvm.dataflow.graph.ApplicationGraph import org.usvm.dataflow.ifds.FlowFunction import org.usvm.dataflow.ifds.FlowFunctions import org.usvm.dataflow.ifds.isOnHeap diff --git a/usvm-jvm-dataflow/src/main/kotlin/org/usvm/dataflow/jvm/unused/UnusedVariableManager.kt b/usvm-jvm-dataflow/src/main/kotlin/org/usvm/dataflow/jvm/unused/UnusedVariableManager.kt index 16ffc2babf..cecde73cad 100644 --- a/usvm-jvm-dataflow/src/main/kotlin/org/usvm/dataflow/jvm/unused/UnusedVariableManager.kt +++ b/usvm-jvm-dataflow/src/main/kotlin/org/usvm/dataflow/jvm/unused/UnusedVariableManager.kt @@ -30,8 +30,8 @@ import kotlinx.coroutines.launch import kotlinx.coroutines.runBlocking import kotlinx.coroutines.withTimeoutOrNull import org.jacodb.api.common.CommonMethod -import org.jacodb.api.common.analysis.ApplicationGraph import org.jacodb.api.common.cfg.CommonInst +import org.usvm.dataflow.graph.ApplicationGraph import org.usvm.dataflow.ifds.ControlEvent import org.usvm.dataflow.ifds.Edge import org.usvm.dataflow.ifds.Manager diff --git a/usvm-jvm-dataflow/src/test/java/org/usvm/dataflow/jvm/impl/JavaAnalysisApiTest.java b/usvm-jvm-dataflow/src/test/java/org/usvm/dataflow/jvm/impl/JavaAnalysisApiTest.java index 0f566c0a34..114feb69ed 100644 --- a/usvm-jvm-dataflow/src/test/java/org/usvm/dataflow/jvm/impl/JavaAnalysisApiTest.java +++ b/usvm-jvm-dataflow/src/test/java/org/usvm/dataflow/jvm/impl/JavaAnalysisApiTest.java @@ -19,12 +19,12 @@ import kotlin.time.DurationUnit; import org.jacodb.api.jvm.JcClassOrInterface; import org.jacodb.api.jvm.JcMethod; -import org.jacodb.api.jvm.analysis.JcApplicationGraph; import org.jacodb.api.jvm.cfg.JcInst; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.TestInstance; import org.usvm.dataflow.jvm.graph.ApplicationGraphFactory; +import org.usvm.dataflow.jvm.graph.JcApplicationGraph; import org.usvm.dataflow.jvm.ifds.JcUnitResolver; import org.usvm.dataflow.jvm.ifds.UnitResolverKt; import org.usvm.dataflow.jvm.taint.TaintManagerKt; diff --git a/usvm-jvm-dataflow/src/test/kotlin/org/usvm/dataflow/jvm/impl/BaseAnalysisTest.kt b/usvm-jvm-dataflow/src/test/kotlin/org/usvm/dataflow/jvm/impl/BaseAnalysisTest.kt index ae9e8e9615..4d076995e8 100644 --- a/usvm-jvm-dataflow/src/test/kotlin/org/usvm/dataflow/jvm/impl/BaseAnalysisTest.kt +++ b/usvm-jvm-dataflow/src/test/kotlin/org/usvm/dataflow/jvm/impl/BaseAnalysisTest.kt @@ -21,7 +21,6 @@ import kotlinx.coroutines.runBlocking import org.jacodb.api.jvm.JcClasspath import org.jacodb.api.jvm.JcDatabase import org.jacodb.api.jvm.JcMethod -import org.jacodb.api.jvm.analysis.JcApplicationGraph import org.jacodb.api.jvm.cfg.JcInst import org.jacodb.api.jvm.ext.findClass import org.jacodb.api.jvm.ext.methods @@ -36,6 +35,7 @@ import org.junit.jupiter.api.AfterAll import org.junit.jupiter.api.Assertions.assertTrue import org.junit.jupiter.params.provider.Arguments import org.usvm.dataflow.ifds.Vulnerability +import org.usvm.dataflow.jvm.graph.JcApplicationGraph import org.usvm.dataflow.jvm.graph.newApplicationGraphForAnalysis import java.io.File import java.util.stream.Stream diff --git a/usvm-jvm-dataflow/src/test/kotlin/org/usvm/dataflow/jvm/impl/TaintFlowFunctionsTest.kt b/usvm-jvm-dataflow/src/test/kotlin/org/usvm/dataflow/jvm/impl/TaintFlowFunctionsTest.kt index cf5c1abb51..ff766f5209 100644 --- a/usvm-jvm-dataflow/src/test/kotlin/org/usvm/dataflow/jvm/impl/TaintFlowFunctionsTest.kt +++ b/usvm-jvm-dataflow/src/test/kotlin/org/usvm/dataflow/jvm/impl/TaintFlowFunctionsTest.kt @@ -20,7 +20,6 @@ import io.mockk.every import io.mockk.mockk import org.jacodb.api.jvm.JcClassType import org.jacodb.api.jvm.JcMethod -import org.jacodb.api.jvm.analysis.JcApplicationGraph import org.jacodb.api.jvm.cfg.JcArgument import org.jacodb.api.jvm.cfg.JcAssignInst import org.jacodb.api.jvm.cfg.JcCallExpr @@ -39,6 +38,7 @@ import org.junit.jupiter.api.Assertions import org.junit.jupiter.api.Test import org.junit.jupiter.api.TestInstance import org.junit.jupiter.api.TestInstance.Lifecycle.PER_CLASS +import org.usvm.dataflow.jvm.graph.JcApplicationGraph import org.usvm.dataflow.jvm.util.JcTraits import org.usvm.dataflow.jvm.util.callee import org.usvm.dataflow.jvm.util.toPath diff --git a/usvm-ts/src/main/kotlin/org/usvm/TSApplicationGraph.kt b/usvm-ts/src/main/kotlin/org/usvm/TSApplicationGraph.kt index 98c113b938..0d2d92a735 100644 --- a/usvm-ts/src/main/kotlin/org/usvm/TSApplicationGraph.kt +++ b/usvm-ts/src/main/kotlin/org/usvm/TSApplicationGraph.kt @@ -1,14 +1,12 @@ package org.usvm import org.jacodb.ets.base.EtsStmt -import org.jacodb.ets.graph.EtsApplicationGraphImpl import org.jacodb.ets.model.EtsFile import org.jacodb.ets.model.EtsMethod -import org.jacodb.ets.model.EtsScene import org.usvm.statistics.ApplicationGraph class TSApplicationGraph(project: EtsFile) : ApplicationGraph { - private val applicationGraph = EtsApplicationGraphImpl(EtsScene(listOf(project))) + private val applicationGraph: ApplicationGraph = TODO() override fun predecessors(node: EtsStmt): Sequence = applicationGraph.predecessors(node) diff --git a/usvm-ts/src/main/kotlin/org/usvm/TSExprResolver.kt b/usvm-ts/src/main/kotlin/org/usvm/TSExprResolver.kt index e28276aa16..b383922130 100644 --- a/usvm-ts/src/main/kotlin/org/usvm/TSExprResolver.kt +++ b/usvm-ts/src/main/kotlin/org/usvm/TSExprResolver.kt @@ -45,6 +45,7 @@ import org.jacodb.ets.base.EtsPostDecExpr import org.jacodb.ets.base.EtsPostIncExpr import org.jacodb.ets.base.EtsPreDecExpr import org.jacodb.ets.base.EtsPreIncExpr +import org.jacodb.ets.base.EtsPtrCallExpr import org.jacodb.ets.base.EtsRemExpr import org.jacodb.ets.base.EtsRightShiftExpr import org.jacodb.ets.base.EtsStaticCallExpr @@ -300,6 +301,10 @@ class TSExprResolver( TODO("Not yet implemented") } + override fun visit(expr: EtsPtrCallExpr): UExpr? { + TODO("Not yet implemented") + } + override fun visit(expr: EtsStrictEqExpr): UExpr { TODO("Not yet implemented") } diff --git a/usvm-ts/src/main/kotlin/org/usvm/TSInterpreter.kt b/usvm-ts/src/main/kotlin/org/usvm/TSInterpreter.kt index 82d56090c5..3e77717b62 100644 --- a/usvm-ts/src/main/kotlin/org/usvm/TSInterpreter.kt +++ b/usvm-ts/src/main/kotlin/org/usvm/TSInterpreter.kt @@ -182,7 +182,7 @@ class TSInterpreter( state.models = listOf(model) state.callStack.push(method, returnSite = null) - state.memory.stack.push(method.parameters.size, method.localsCount) + state.memory.stack.push(method.parameters.size, method.locals.size) state.pathNode += method.cfg.instructions.first() return state