diff --git a/usvm-ts/src/main/kotlin/org/usvm/TSExprResolver.kt b/usvm-ts/src/main/kotlin/org/usvm/TSExprResolver.kt index 108b4ad54..24d39f5fc 100644 --- a/usvm-ts/src/main/kotlin/org/usvm/TSExprResolver.kt +++ b/usvm-ts/src/main/kotlin/org/usvm/TSExprResolver.kt @@ -85,7 +85,7 @@ class TSExprResolver( fun resolveLValue(value: EtsValue): ULValue<*, *>? = when (value) { is EtsParameterRef, - is EtsLocal -> simpleValueResolver.resolveLocal(value) + is EtsLocal, -> simpleValueResolver.resolveLocal(value) else -> error("Unexpected value: $value") } diff --git a/usvm-ts/src/test/kotlin/org/usvm/util/TSMethodTestRunner.kt b/usvm-ts/src/test/kotlin/org/usvm/util/TSMethodTestRunner.kt index 59a30b97c..45a10d918 100644 --- a/usvm-ts/src/test/kotlin/org/usvm/util/TSMethodTestRunner.kt +++ b/usvm-ts/src/test/kotlin/org/usvm/util/TSMethodTestRunner.kt @@ -89,6 +89,14 @@ open class TSMethodTestRunner : TestRunner Boolean + get() = { _, _ -> true } + override val typeTransformer: (Any?) -> EtsType get() = { // Both KClass and TSObject instances come here @@ -108,13 +116,6 @@ open class TSMethodTestRunner : TestRunner Boolean - get() = { _, _ -> true } - private fun getProject(fileName: String): EtsFile { val jsonWithoutExtension = "/ir/$fileName.json" val sampleFilePath = javaClass.getResourceAsStream(jsonWithoutExtension) diff --git a/usvm-ts/src/test/kotlin/org/usvm/util/TSTestResolver.kt b/usvm-ts/src/test/kotlin/org/usvm/util/TSTestResolver.kt index dae64ad01..bd473cc7c 100644 --- a/usvm-ts/src/test/kotlin/org/usvm/util/TSTestResolver.kt +++ b/usvm-ts/src/test/kotlin/org/usvm/util/TSTestResolver.kt @@ -29,7 +29,8 @@ class TSTestResolver { val model = state.models.first() when (val methodResult = state.methodResult) { is TSMethodResult.Success -> { - val returnValue = resolveExpr(model.eval(methodResult.value), method.returnType) + val valueToResolve = model.eval(methodResult.value) + val returnValue = resolveExpr(valueToResolve, method.returnType) val params = method.parameters.mapIndexed { idx, param -> val lValue = URegisterStackLValue(typeToSort(param.type), idx) val expr = model.read(lValue)