Skip to content

Commit 622d192

Browse files
committed
Refine api
1 parent 2892497 commit 622d192

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

usvm-ts/src/main/kotlin/org/usvm/machine/TsContext.kt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ import org.usvm.UBv32Sort
1818
import org.usvm.UConcreteHeapRef
1919
import org.usvm.UContext
2020
import org.usvm.UExpr
21-
import org.usvm.UHeapRef
2221
import org.usvm.USort
2322
import org.usvm.collection.field.UFieldLValue
2423
import org.usvm.isTrue
@@ -103,7 +102,7 @@ class TsContext(
103102
return ref
104103
}
105104

106-
fun UHeapRef.extractSingleValueFromFakeObjectOrNull(scope: TsStepScope): UExpr<out USort>? {
105+
fun UExpr<out USort>.extractSingleValueFromFakeObjectOrNull(scope: TsStepScope): UExpr<out USort>? {
107106
if (!isFakeObject()) return null
108107

109108
val type = scope.calcOnState {

usvm-ts/src/main/kotlin/org/usvm/machine/operator/TsBinaryOperator.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,8 @@ sealed interface TsBinaryOperator {
5656
rhs: UExpr<out USort>,
5757
scope: TsStepScope,
5858
): UExpr<out USort> {
59-
val lhsValue = if (lhs.isFakeObject()) lhs.extractSingleValueFromFakeObjectOrNull(scope) ?: lhs else lhs
60-
val rhsValue = if (rhs.isFakeObject()) rhs.extractSingleValueFromFakeObjectOrNull(scope) ?: rhs else rhs
59+
val lhsValue = lhs.extractSingleValueFromFakeObjectOrNull(scope) ?: lhs
60+
val rhsValue = rhs.extractSingleValueFromFakeObjectOrNull(scope) ?: rhs
6161

6262
if (lhsValue.isFakeObject() || rhsValue.isFakeObject()) {
6363
return resolveFakeObject(lhsValue, rhsValue, scope)

0 commit comments

Comments
 (0)