Skip to content

Commit 1c0b026

Browse files
committed
Resolve class type in NewExpr during constructor resolution
1 parent 64abc0a commit 1c0b026

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

usvm-dataflow-ts/src/main/kotlin/org/usvm/dataflow/ts/graph/EtsApplicationGraph.kt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,14 @@ class EtsApplicationGraphImpl(
148148
lookupClassWithIdealSignature(sig).onSome { c ->
149149
return sequenceOf(c.ctor)
150150
}
151+
} else {
152+
val resolved = cp.projectAndSdkClasses
153+
.asSequence()
154+
.filter { compareClassSignatures(it.signature, sig) != ComparisonResult.NotEqual }
155+
.singleOrNull()
156+
if (resolved != null) {
157+
return sequenceOf(resolved.ctor)
158+
}
151159
}
152160
}
153161

usvm-dataflow-ts/src/test/kotlin/org/usvm/dataflow/ts/test/EtsTypeInferenceTest.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ class EtsTypeInferenceTest {
8686
}
8787

8888
val manager = TypeInferenceManager(EtsTraits(), graph)
89-
val result = manager.analyze(entrypoints)
89+
val result = manager.analyze(entrypoints, doAddKnownTypes = false)
9090
val types = result.inferredTypes
9191

9292
run {

0 commit comments

Comments
 (0)